mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chunfeng Yun (云春峰)" <Chunfeng.Yun@mediatek.com>
To: "robh@kernel.org" <robh@kernel.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	"kishon@kernel.org" <kishon@kernel.org>,
	"heiko@sntech.de" <heiko@sntech.de>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-phy@lists.infradead.org" <linux-phy@lists.infradead.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-rockchip@lists.infradead.org"
	<linux-rockchip@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] phy: Use (of|device)_property_present() for non-boolean properties
Date: Mon, 6 Jan 2025 14:59:18 +0000	[thread overview]
Message-ID: <93e3073207cc2c01aa0f6b9a8c39cb091e4b9081.camel@mediatek.com> (raw)
In-Reply-To: <20241231163121.241543-1-robh@kernel.org>

On Tue, 2024-12-31 at 10:31 -0600, Rob Herring (Arm) wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> The use of (of|device)_property_read_bool() for non-boolean
> properties
> is deprecated in favor of (of|device)_property_present() when testing
> for property presence.
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
>  drivers/phy/mediatek/phy-mtk-tphy.c           | 4 ++--
>  drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c
> b/drivers/phy/mediatek/phy-mtk-tphy.c
> index 3f7095ec5978..d36f68dd622e 100644
> --- a/drivers/phy/mediatek/phy-mtk-tphy.c
> +++ b/drivers/phy/mediatek/phy-mtk-tphy.c
> @@ -1215,7 +1215,7 @@ static int phy_type_syscon_get(struct
> mtk_phy_instance *instance,
>         int ret;
> 
>         /* type switch function is optional */
> -       if (!of_property_read_bool(dn, "mediatek,syscon-type"))
> +       if (!of_property_present(dn, "mediatek,syscon-type"))
>                 return 0;
> 
>         ret = of_parse_phandle_with_fixed_args(dn, "mediatek,syscon-
> type",
> @@ -1278,7 +1278,7 @@ static int phy_efuse_get(struct mtk_tphy *tphy,
> struct mtk_phy_instance *instanc
>         }
> 
>         /* software efuse is optional */
> -       instance->efuse_sw_en = device_property_read_bool(dev,
> "nvmem-cells");
> +       instance->efuse_sw_en = device_property_present(dev, "nvmem-
> cells");
>         if (!instance->efuse_sw_en)
>                 return 0;
> 
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index 96f3d868a526..b5e6a864deeb 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -440,7 +440,7 @@ static int
> rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy)
>         struct extcon_dev *edev;
>         int ret;
> 
> -       if (of_property_read_bool(node, "extcon")) {
> +       if (of_property_present(node, "extcon")) {
>                 edev = extcon_get_edev_by_phandle(rphy->dev, 0);
>                 if (IS_ERR(edev))
>                         return dev_err_probe(rphy->dev,
> PTR_ERR(edev),
> @@ -1323,7 +1323,7 @@ static int
> rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
>                         goto out;
>                 }
> 
> -               if (!of_property_read_bool(rphy->dev->of_node,
> "extcon")) {
> +               if (!of_property_present(rphy->dev->of_node,
> "extcon")) {
>                         /* do initial sync of usb state */
>                         id = property_enabled(rphy->grf, &rport-
> >port_cfg->utmi_id);
>                         extcon_set_state_sync(rphy->edev,
> EXTCON_USB_HOST, !id);
> --
> 2.45.2
> 
For MediaTek:

Reviewed-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Thanks


  parent reply	other threads:[~2025-01-06 14:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-31 16:31 Rob Herring (Arm)
2025-01-02 12:38 ` AngeloGioacchino Del Regno
2025-01-06 14:59 ` Chunfeng Yun (云春峰) [this message]
2025-02-03 18:49 ` Rob Herring
2025-02-10 17:21 ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93e3073207cc2c01aa0f6b9a8c39cb091e4b9081.camel@mediatek.com \
    --to=chunfeng.yun@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=heiko@sntech.de \
    --cc=kishon@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®