From nobody Fri Jun 12 21:29:44 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 910293905EE; Tue, 12 May 2026 13:06:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778591167; cv=none; b=CS0nYiXCBSEkUcldIypD3VNOuuuw2Loh1D+wQlSt1OnEb0n6cSCXnxFoIW+lH2nt+ha6Eod8wC3KIWU+BSVxmTtJsyuX8BK+v2Zigu3aqsSnBFR5b+ByMteo3BImdu29HgFkJT4AF8C7YQGhQk5lB6FZBGi0xzd2oFsaeiOAz7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778591167; c=relaxed/simple; bh=dwFBnLXsBSJhM0CEDgNPKRthY1LonLKx8Vv5G4u3TV8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dpGUK6AhYDfXhcFbf4fX/xSCTqslBFltnwPjITITvxpPm8k3leVzJwBkzd9OQO24sdiAskw6cu3TXgcuHD6H5CAcJq8QrOuIx1oNRJF5BbDHuiAIajSocoJYp1/4dQuQez4dLoIcbabtbHFzFmktNTU89/lu34Zk7Z0Mb7xq6lk= 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=HfidDW5F; arc=none smtp.client-ip=198.175.65.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="HfidDW5F" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778591167; x=1810127167; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dwFBnLXsBSJhM0CEDgNPKRthY1LonLKx8Vv5G4u3TV8=; b=HfidDW5FfuJhrLX34jepDLrgSy6ROgkNmM5cvwQ9WuZlr6VS2grj/REp TUnR2PXEG09tSC1v4MQXZc3LIwkWEWaI9ESoTOYT5Q4UEELoBcsP7Jrbc WcJ7kTcBBtKbUP/pQD6xHRnqD9IrjLPdfhzQG4pmlB0VJOp+cJsxoFZab rE0WbfV0vhUuzVKiH8oCcuJSK3GhD4yNhToq5I5oF2xyD1BwRLvFw6ku3 J++1CO365OzDmGNJJVJR4xhxx6Iy1NzLDVfVm68jTNoOYVdqrIN02xTj0 TMk1/0vafPylnOC4igCf7Kc8bhaaKAM2NQ2xFBEhr8RFD81C/WVYDMl2j g==; X-CSE-ConnectionGUID: dimG4HqYTNCN7qTCgi0thA== X-CSE-MsgGUID: 6aIMw2EITjqhBaG41BG33g== X-IronPort-AV: E=McAfee;i="6800,10657,11783"; a="90600355" X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="90600355" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2026 06:06:00 -0700 X-CSE-ConnectionGUID: Y+1uMqVPSRezwEe6MW80Hw== X-CSE-MsgGUID: cGT3AJYYR/q/bPajHAkS5g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="233294181" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa006.fm.intel.com with ESMTP; 12 May 2026 06:05:56 -0700 Received: by black.igk.intel.com (Postfix, from userid 1003) id 7094699; Tue, 12 May 2026 15:05:55 +0200 (CEST) From: Andy Shevchenko To: Peng Fan , 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 v4 1/5] phy: phy-can-transceiver: Check driver match and driver data against NULL Date: Tue, 12 May 2026 15:01:49 +0200 Message-ID: <20260512130552.272476-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260512130552.272476-1-andriy.shevchenko@linux.intel.com> References: <20260512130552.272476-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" Every platform driver can be forced to match a device that doesn't match its list of device IDs because of device_match_driver_override() so platform drivers that rely on the existence of a device's driver data need to verify its presence. Accordingly, add requisite match and driver data checks against NULL to the driver where they are missing. Fixes: a4a86d273ff1 ("phy: phy-can-transceiver: Add support for generic CAN= transceiver driver") Signed-off-by: Andy Shevchenko --- drivers/phy/phy-can-transceiver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transc= eiver.c index 2b52e47f247a..1808f903c057 100644 --- a/drivers/phy/phy-can-transceiver.c +++ b/drivers/phy/phy-can-transceiver.c @@ -162,6 +162,9 @@ static int can_transceiver_phy_probe(struct platform_de= vice *pdev) int err, i, num_ch =3D 1; =20 match =3D of_match_node(can_transceiver_phy_ids, pdev->dev.of_node); + if (!match || !match->data) + return -ENODEV; + drvdata =3D match->data; if (drvdata->flags & CAN_TRANSCEIVER_DUAL_CH) num_ch =3D 2; --=20 2.50.1 From nobody Fri Jun 12 21:29:44 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 D1D43394E91; Tue, 12 May 2026 13:06:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778591171; cv=none; b=aMYezXwfncFZfGTlcCbwXkjiMnNNcs7/X/JJ83XrdO77j1xSxlR8a43ZsT2yBdoUfhU99teJKAH2WTlptjkWUrkJZomlAeZdLMlW7YZt1OIPhXX4w29K46Kju37mym/bIjasMXVI3Xfkx4JuX/LnAIL+p7GPf/PaInyzaEOI/AQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778591171; c=relaxed/simple; bh=bHWrPhTiJL2fP/DH1DaMkMAaneZI5rRXmH5SsOzULJw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iDf1z6kDJh/QETmY6s1pIpebgiroxYu66Nw9d7sWCzKl78ktJ6BdNOaAsQo3Q0rV9qmTfFuAnP2Ec9Zm2yvH0nVxejmTX1hyNKCXW/gg1iytSy9UcTpHkZq26zk1yQX6TBABM3hiKa0J4VrK9tNRl9/bzMDmjkwaNhyb6YuwqFI= 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=ftif8nLZ; arc=none smtp.client-ip=198.175.65.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="ftif8nLZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778591170; x=1810127170; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bHWrPhTiJL2fP/DH1DaMkMAaneZI5rRXmH5SsOzULJw=; b=ftif8nLZqp18Dbb/E4fqH7pPjIqM1sYnotR0C+m2qDx/aAK+flVGCKwG dBHleRpvdEWONw3olHO6bH9Ui0odBCRjinpcD8WFZ9l/4cGsl9DtKd6if i3Q+x7FOPqnx1wTi+iTvNjpSR96aoNj6N+Lf4WhWsA3Q2ncke9LyuYxEh RJj/HyT+hRxWyfRHqXIWAMPGObV/io2Ctku6Dy5yTsir0QYYN/vAQwjLQ zkZAPBZGaHkBP5DY/UCEUzYI/8mz+lybDraQUix/WljCEaMBdolCZWu6q vVHmn4SA7Z6DIP0XlJTLPQJv558yysSacVgcDEZ7gguOaDSN/L7OV0MCH A==; X-CSE-ConnectionGUID: bG2iSKb5QwqnTIut/nwiHA== X-CSE-MsgGUID: 5m3YPKQtSZ2h+smVYZFsrA== X-IronPort-AV: E=McAfee;i="6800,10657,11783"; a="90600384" X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="90600384" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2026 06:06:00 -0700 X-CSE-ConnectionGUID: /mJvE0wNS7anVBFuForJMQ== X-CSE-MsgGUID: a2XOIYexRYGNV6ODYrbgFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="233294184" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa006.fm.intel.com with ESMTP; 12 May 2026 06:05:56 -0700 Received: by black.igk.intel.com (Postfix, from userid 1003) id 74E8A9B; Tue, 12 May 2026 15:05:55 +0200 (CEST) From: Andy Shevchenko To: Peng Fan , 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 v4 2/5] phy: phy-can-transceiver: use device_get_match_data() Date: Tue, 12 May 2026 15:01:50 +0200 Message-ID: <20260512130552.272476-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260512130552.272476-1-andriy.shevchenko@linux.intel.com> References: <20260512130552.272476-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" Use the generic firmware node interface for retrieving device match data instead of the OF-specific one. While at it, drop unneeded argument to devm_phy_create() which extracts device node from the given device by default. Reviewed-by: Josua Mayer Signed-off-by: Andy Shevchenko --- drivers/phy/phy-can-transceiver.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transc= eiver.c index 1808f903c057..5cfd09735204 100644 --- a/drivers/phy/phy-can-transceiver.c +++ b/drivers/phy/phy-can-transceiver.c @@ -5,9 +5,9 @@ * Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com * */ -#include #include #include +#include #include #include #include @@ -152,7 +152,6 @@ static int can_transceiver_phy_probe(struct platform_de= vice *pdev) struct can_transceiver_phy *can_transceiver_phy; struct can_transceiver_priv *priv; const struct can_transceiver_data *drvdata; - const struct of_device_id *match; struct phy *phy; struct gpio_desc *silent_gpio; struct gpio_desc *standby_gpio; @@ -161,11 +160,10 @@ static int can_transceiver_phy_probe(struct platform_= device *pdev) u32 max_bitrate =3D 0; int err, i, num_ch =3D 1; =20 - match =3D of_match_node(can_transceiver_phy_ids, pdev->dev.of_node); - if (!match || !match->data) + drvdata =3D device_get_match_data(dev); + if (drvdata) return -ENODEV; =20 - drvdata =3D match->data; if (drvdata->flags & CAN_TRANSCEIVER_DUAL_CH) num_ch =3D 2; =20 @@ -190,7 +188,7 @@ static int can_transceiver_phy_probe(struct platform_de= vice *pdev) can_transceiver_phy =3D &priv->can_transceiver_phy[i]; can_transceiver_phy->priv =3D priv; =20 - phy =3D devm_phy_create(dev, dev->of_node, &can_transceiver_phy_ops); + phy =3D devm_phy_create(dev, NULL, &can_transceiver_phy_ops); if (IS_ERR(phy)) { dev_err(dev, "failed to create can transceiver phy\n"); return PTR_ERR(phy); --=20 2.50.1 From nobody Fri Jun 12 21:29:44 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 091EC39061E; Tue, 12 May 2026 13:06:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778591169; cv=none; b=Me1qJ6mFds8AjZHjktDA8j9ql5uhiCOItc8qRynIhgJXEznHLizUnfVxMz+BW0OLL39QgsJrHV0I+eZjCfyvxu9b1WoNuYoSnbm+KNGgA5NF0kdTbsbvHY/RSlFUwRL9ir1uLBEosOe+VrgzjdeYdQKs8MiDJrPDZjtazKboDtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778591169; c=relaxed/simple; bh=DFpP2BywYHyUrUe3gUXm2RcGaGgJHXXxZahrn5QB5vw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hJ0KZ3wAYAAJcpRWyeknQdn7eIyraPM8f4Jf1ExAaVUibwy4lP1Ghfy4DlRxJygW9vw6b+UOUa897KKiBLLBYlBbDm4cyUqPoK+StsIWm41HNI13KsrD+Pi+Dti3yGTZeuLhhY/eLNq2mZq2Q5AsZv8ZQq3L7baGaiAEmjyTJQg= 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=TjzFOZJW; arc=none smtp.client-ip=198.175.65.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="TjzFOZJW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778591169; x=1810127169; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DFpP2BywYHyUrUe3gUXm2RcGaGgJHXXxZahrn5QB5vw=; b=TjzFOZJWbNAS+t8BzlzE+AwdepAzBppB0n2gs4Uci/kTY+x9KGwPO2aJ yk3xy1JHA/siWr84MwDa2xGrNyJR7IkQwAZ/sk0Oj+A4RJT97movsClz/ 4G6PA/d5CaV1BcdIGddj4RqDMQM08mdGKib9RI8O95+Ds04k92+X6Lzj/ NrWeQ4Qv+Hwf91Y9Haa4cu+zM8mToD4588XE/IVxkgTe+SzfJdP71ggIO kqDxwTcLQiUFIAoWR/YeyEWmPPM3n7m9PQEeErIbNBUuaesVB2VbFyRZm RPc645VjPAPy9W5EyGhMgWlUWk/GQxiQQXYDC/rKrM7CI79yapQuKjTZF A==; X-CSE-ConnectionGUID: IhIghppqTTufmgOhTad0cg== X-CSE-MsgGUID: 4J/fct5XS/icOQeka1/yZA== X-IronPort-AV: E=McAfee;i="6800,10657,11783"; a="90600365" X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="90600365" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2026 06:06:00 -0700 X-CSE-ConnectionGUID: iU50rI4sSTeEvqb/tFGa9w== X-CSE-MsgGUID: qQdk7x+jRguKr//SLma6Mw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="233294182" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa006.fm.intel.com with ESMTP; 12 May 2026 06:05:56 -0700 Received: by black.igk.intel.com (Postfix, from userid 1003) id 794709D; Tue, 12 May 2026 15:05:55 +0200 (CEST) From: Andy Shevchenko To: Peng Fan , 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 v4 3/5] phy: phy-can-transceiver: Move OF ID table closer to their user Date: Tue, 12 May 2026 15:01:51 +0200 Message-ID: <20260512130552.272476-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260512130552.272476-1-andriy.shevchenko@linux.intel.com> References: <20260512130552.272476-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 | 58 +++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transc= eiver.c index 5cfd09735204..23655956ace8 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) { @@ -232,6 +203,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 { --=20 2.50.1 From nobody Fri Jun 12 21:29:44 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 92CB03911D5; Tue, 12 May 2026 13:06:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778591170; cv=none; b=BiJgm79MNxj1h5U679gm5ZFVq/BensD7obUyYlEzJ+pXlrzHpvW87COpnQ63fYMRVWvS0I5WIfTjrQEpyeL3wobbA05Dj0dJZbOqyjJi6+y0fq8c/+ZSEVNx6RgyZ5N2rEhH4BYjuG2oK0W6EC4DuORdawxLr2d0o2/En0nWhW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778591170; c=relaxed/simple; bh=aWyJaQvi0RjHwj/BHyzTjrlBIlDr2rwbaqRKmtrI03w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qyepy3LWDbCIwLvOHSTU+SQR7N3ppb/W7tvRMYkv8tYKMmzrbRjo9mUDJG4bllcKBkPWXnnpwLL+Ako8XCWQlaKdCaSNK1hChlmjcIYi01Kaq+uAFq1vpA2ezD/QuTC/SV7I8EspiE0QwTXVklfA/7bOL61KinLmyOMOH6PXc3k= 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=fw9pmucW; arc=none smtp.client-ip=198.175.65.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="fw9pmucW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778591170; x=1810127170; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aWyJaQvi0RjHwj/BHyzTjrlBIlDr2rwbaqRKmtrI03w=; b=fw9pmucWvHs3dYCdcIcb65Z4AmV4YmlRIiOvewAbkOPOlzxOkb3dpacT LmaVLufeF2CXaRbBOvwZeGRG5biwZBSBeODnOSdBcYHoitUnLlk0bSK+2 LTWUoQS7Y10TksCh/D9g7oGOcpiVZI3K65EazTazlvtgaWvA44vf8oOjd 3zzJtQ4x9yM30bxnK/PWUgY0V2zY0YGUCndH11jOtCeZZJ3gJkzorAkdC XKeiJWB4iU4rrpfvBEQnWlTUp38Llyln6MB3l8xPPIFm2DJrZdf3ygDWH CYMEyifWBy8Tl/OQbSV+oOjwYAPPNYWNGhZBvYtii1TCGozfY195keAqX w==; X-CSE-ConnectionGUID: tztUK6ynSoGSO/x6I4SAWA== X-CSE-MsgGUID: Mc3TIszZSmajRcxVvO4Qig== X-IronPort-AV: E=McAfee;i="6800,10657,11783"; a="90600382" X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="90600382" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2026 06:06:00 -0700 X-CSE-ConnectionGUID: mRMRMezYS/KqyfWN7E09fw== X-CSE-MsgGUID: sf3sO/OxQ06rWeh6Hr3eLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="233294183" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa006.fm.intel.com with ESMTP; 12 May 2026 06:05:56 -0700 Received: by black.igk.intel.com (Postfix, from userid 1003) id 7DD1C9E; Tue, 12 May 2026 15:05:55 +0200 (CEST) From: Andy Shevchenko To: Peng Fan , 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 v4 4/5] phy: phy-can-transceiver: Don't check for specific errors when parsing properties Date: Tue, 12 May 2026 15:01:52 +0200 Message-ID: <20260512130552.272476-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260512130552.272476-1-andriy.shevchenko@linux.intel.com> References: <20260512130552.272476-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" Instead of checking for the specific error codes (that can be considered a layering violation to some extent) check for the property existence first and then either parse it, or apply a default value. With that, return an error when parsing of the existing property fails. Signed-off-by: Andy Shevchenko --- drivers/phy/phy-can-transceiver.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transc= eiver.c index 23655956ace8..973cc7ce651f 100644 --- a/drivers/phy/phy-can-transceiver.c +++ b/drivers/phy/phy-can-transceiver.c @@ -128,8 +128,9 @@ static int can_transceiver_phy_probe(struct platform_de= vice *pdev) struct gpio_desc *standby_gpio; struct gpio_desc *enable_gpio; struct mux_state *mux_state; - u32 max_bitrate =3D 0; int err, i, num_ch =3D 1; + const char *propname; + u32 max_bitrate; =20 drvdata =3D device_get_match_data(dev); if (drvdata) @@ -151,9 +152,17 @@ static int can_transceiver_phy_probe(struct platform_d= evice *pdev) =20 priv->mux_state =3D mux_state; =20 - err =3D device_property_read_u32(dev, "max-bitrate", &max_bitrate); - if ((err !=3D -EINVAL) && !max_bitrate) - dev_warn(dev, "Invalid value for transceiver max bitrate. Ignoring bitra= te limit\n"); + propname =3D "max-bitrate"; + if (device_property_present(dev, propname)) { + err =3D device_property_read_u32(dev, propname, &max_bitrate); + if (err) + return dev_err_probe(dev, err, "failed to parse %s\n", propname); + + if (max_bitrate =3D=3D 0) + dev_warn(dev, "Invalid value for transceiver max bitrate. Ignoring bitr= ate limit\n"); + } else { + max_bitrate =3D 0; + } =20 for (i =3D 0; i < num_ch; i++) { can_transceiver_phy =3D &priv->can_transceiver_phy[i]; --=20 2.50.1 From nobody Fri Jun 12 21:29:44 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 2D4841A267; Tue, 12 May 2026 13:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778591164; cv=none; b=UHO0xzhC8SKkZdKuykgWFqRpAQVFzpvA6MqlIz1ewwll/U4JwrMXSLKcfoeVpl8841cvBfcmaXbjq7UHjiC5hcszD9I4kZrksxa96yHNLckdWuSkrDTr8X7kpSdfd4IcEYwOOYy3z8q6XnkVgwy53cfTPEaPcn+N1JhFP+aroRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778591164; c=relaxed/simple; bh=4qMUuS6h5tFlP1suIW3fbkhM5BGhQH4sMAaS62b/lnw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oE9NyHpBVm7L2KHkNRape6Kj4rdtaJoDHbvYE/+mD6FVt3Vdyb3/frWvtQqpmDVYPrQUcTXtDEGHHckvk6Ze4k9zQg6bBXvYPSHAN1QWrBUYVhTb6FrtMn2hhQPfWKvcVEbibcoGnTvoerKntxHP3+SWOtcjm7+1OkCCKFyrdWw= 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=mEaIEb6y; arc=none smtp.client-ip=192.198.163.12 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="mEaIEb6y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778591163; x=1810127163; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4qMUuS6h5tFlP1suIW3fbkhM5BGhQH4sMAaS62b/lnw=; b=mEaIEb6y3U27upKE3oH7aIrMCUHhzPbKSLkzCRQs7jTm/yQsaugfGcpw DbNAuguLXlDoFWpakaFbgo1diC3xWE8hbWAfA1aNoJT9+r4ahBazmsYqQ KsJz8s2t5LtZV6s1Qdl9dbGm9DTgZN7VqdSDJ5+m2axH3QrACTQTMJU70 6ZTSu+NtOJ9dSdfhBe5FTstZoBzudd9xFWJNrY7S6rDlLht0VWWLLZ8QJ orrjgKtQ1w0Sx2oGar3hPV0OwPb1r6O8T441/A0+lPw4poazyoU2B2hbF /ViocZorOHcc2z8qzzVxfFiO+woyil0ibBCabxcPvJr3pPnoYm1DQzZjz Q==; X-CSE-ConnectionGUID: EbeAaGSqQkqmIzktj/WaMw== X-CSE-MsgGUID: 50mnGEoGQmqgldKfp7+vnA== X-IronPort-AV: E=McAfee;i="6800,10657,11783"; a="83351805" X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="83351805" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2026 06:06:02 -0700 X-CSE-ConnectionGUID: RDmrtmE8RCiVomwOCGEuRg== X-CSE-MsgGUID: 2anfmBf/T9ul3t+yFab0jw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,230,1770624000"; d="scan'208";a="236903550" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa010.jf.intel.com with ESMTP; 12 May 2026 06:05:59 -0700 Received: by black.igk.intel.com (Postfix, from userid 1003) id 81DBDA1; Tue, 12 May 2026 15:05:55 +0200 (CEST) From: Andy Shevchenko To: Peng Fan , 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 v4 5/5] phy: phy-can-transceiver: Drop unused include Date: Tue, 12 May 2026 15:01:53 +0200 Message-ID: <20260512130552.272476-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260512130552.272476-1-andriy.shevchenko@linux.intel.com> References: <20260512130552.272476-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" This file does not use the symbols from the legacy header, so let's drop it. Reviewed-by: Josua Mayer Signed-off-by: Andy Shevchenko --- drivers/phy/phy-can-transceiver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transc= eiver.c index 973cc7ce651f..534a4fc482aa 100644 --- a/drivers/phy/phy-can-transceiver.c +++ b/drivers/phy/phy-can-transceiver.c @@ -5,12 +5,11 @@ * Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com * */ +#include #include #include #include #include -#include -#include #include =20 struct can_transceiver_data { --=20 2.50.1