From nobody Fri Apr 3 12:26:35 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48A9E38A731; Tue, 17 Mar 2026 20:30:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773779428; cv=none; b=qwe+ypFy876sV5HACqXVx7YOBR1xnOspVC39JVAA5nptCnV3FjmWCj8mJMLhQu7ftcNjHRaCOK+3wOvbQuupVLMToBTDozP7n+qeScbrRYb+h36ZCgM+l6Rafe24LUhq5jybKjivZRo70Xe7Sft9D1u5DfUqOIrvZkAj1l+/N+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773779428; c=relaxed/simple; bh=Oq3l+I9h8bxaIHyJ/kIHrAomOtzhSbrAao5gin/3sdQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ob3SVuN1iWGpdiGyK5dUKwaGdHI3A4VwXRBh8UM9s0Mz9Mg/irt8CCbwraCxAzmsC0dk1JRFj3v2n+dn520P9mXz6nsT18FyAGrDEiawWjKy8E7w4/oq00DswrE6wl/+e/LU98s253Ebd3U4ei67GewAmjYbEHSzi/++kw6lixk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=F16QGDjB; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="F16QGDjB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1773779427; x=1805315427; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Oq3l+I9h8bxaIHyJ/kIHrAomOtzhSbrAao5gin/3sdQ=; b=F16QGDjBIEAV5zdPvpi+k3JSEBUCfgy3r2DDAqijkUfshoFyFONWLFkt rowfWvj8Ely9dWHyDI8RHyptuTnlRc9WMlI5DjNKACbVrsjuhta6I5xWA gcGh/P3hmB30NvqA6BMUQhsRO2IF6hyLeuUtK6WFEUGlJmPetvSY51JKJ 4jEYhzA0HtcG9VvqFCMES8ePgKDx9Cji0rSjbqDnyf8j/7uWdg8i4bSf7 OmwrRn0GfDDSGR+f4Wk1lAk/Qci+NGZ+yHpyuZx4fTc3H6wQz3GG+OHKr 3+x8xQ2OH5i3vtrubMsxa0152wih6WYQIiTHvGyw6uMHr/to8cXl4ugOw Q==; X-CSE-ConnectionGUID: o/lWcCvqQH+rH2APEmTntA== X-CSE-MsgGUID: zrApQoEwSxSGt6LlVaz+zA== X-IronPort-AV: E=McAfee;i="6800,10657,11732"; a="77433972" X-IronPort-AV: E=Sophos;i="6.23,126,1770624000"; d="scan'208";a="77433972" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2026 13:30:24 -0700 X-CSE-ConnectionGUID: Xd0iMxh0TtG2dbBYlEslmg== X-CSE-MsgGUID: s1IOXLqmTaa7kjpD9F72uQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,126,1770624000"; d="scan'208";a="222434442" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa008.jf.intel.com with ESMTP; 17 Mar 2026 13:30:22 -0700 Received: by black.igk.intel.com (Postfix, from userid 1003) id 094F499; Tue, 17 Mar 2026 21:30:20 +0100 (CET) From: Andy Shevchenko To: linux-can@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marc Kleine-Budde , Vincent Mailhol , Vinod Koul , Neil Armstrong , Josua Mayer , Ulf Hansson , Andy Shevchenko Subject: [PATCH v2 2/4] phy: phy-can-transceiver: Move OF ID table closer to their user Date: Tue, 17 Mar 2026 21:27:28 +0100 Message-ID: <20260317203001.2108568-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260317203001.2108568-1-andriy.shevchenko@linux.intel.com> References: <20260317203001.2108568-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There is no code that uses ID table directly, except the struct device_driver at the end of the file. Hence, move table closer to its user. It's always possible to access them via a pointer. Signed-off-by: Andy Shevchenko --- drivers/phy/phy-can-transceiver.c | 59 +++++++++++++++---------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transc= eiver.c index 80eece74f77d..aaed8d08fcf0 100644 --- a/drivers/phy/phy-can-transceiver.c +++ b/drivers/phy/phy-can-transceiver.c @@ -97,35 +97,6 @@ static const struct can_transceiver_data tja1057_drvdata= =3D { .flags =3D CAN_TRANSCEIVER_SILENT_PRESENT, }; =20 -static const struct of_device_id can_transceiver_phy_ids[] =3D { - { - .compatible =3D "ti,tcan1042", - .data =3D &tcan1042_drvdata - }, - { - .compatible =3D "ti,tcan1043", - .data =3D &tcan1043_drvdata - }, - { - .compatible =3D "nxp,tja1048", - .data =3D &tja1048_drvdata - }, - { - .compatible =3D "nxp,tja1051", - .data =3D &tja1051_drvdata - }, - { - .compatible =3D "nxp,tja1057", - .data =3D &tja1057_drvdata - }, - { - .compatible =3D "nxp,tjr1443", - .data =3D &tcan1043_drvdata - }, - { } -}; -MODULE_DEVICE_TABLE(of, can_transceiver_phy_ids); - static struct phy *can_transceiver_phy_xlate(struct device *dev, const struct of_phandle_args *args) { @@ -229,6 +200,35 @@ static int can_transceiver_phy_probe(struct platform_d= evice *pdev) return PTR_ERR_OR_ZERO(phy_provider); } =20 +static const struct of_device_id can_transceiver_phy_ids[] =3D { + { + .compatible =3D "ti,tcan1042", + .data =3D &tcan1042_drvdata + }, + { + .compatible =3D "ti,tcan1043", + .data =3D &tcan1043_drvdata + }, + { + .compatible =3D "nxp,tja1048", + .data =3D &tja1048_drvdata + }, + { + .compatible =3D "nxp,tja1051", + .data =3D &tja1051_drvdata + }, + { + .compatible =3D "nxp,tja1057", + .data =3D &tja1057_drvdata + }, + { + .compatible =3D "nxp,tjr1443", + .data =3D &tcan1043_drvdata + }, + { } +}; +MODULE_DEVICE_TABLE(of, can_transceiver_phy_ids); + static struct platform_driver can_transceiver_phy_driver =3D { .probe =3D can_transceiver_phy_probe, .driver =3D { @@ -236,7 +236,6 @@ static struct platform_driver can_transceiver_phy_drive= r =3D { .of_match_table =3D can_transceiver_phy_ids, }, }; - module_platform_driver(can_transceiver_phy_driver); =20 MODULE_AUTHOR("Faiz Abbas "); --=20 2.50.1