[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXv+5Gmzu-w0Oi8dUv-a6v1=S8L5otgCfppbAXm1g+jMZFj8Q@mail.gmail.com>
Date: Mon, 21 Feb 2022 12:33:22 +0800
From: Chen-Yu Tsai <wenst@...omium.org>
To: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
Cc: sean.wang@...nel.org, linus.walleij@...aro.org,
matthias.bgg@...il.com, linux-mediatek@...ts.infradead.org,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, kernel@...labora.com
Subject: Re: [PATCH 2/5] pinctrl: mediatek: common-v1: Add common probe function
On Thu, Feb 10, 2022 at 10:20 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com> wrote:
>
> As a preparation to cleanup the probe mechanism of mediatek pinctrl
> drivers that are using the v1 controller, add a common probe function
> to this driver.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Reviewed-by: Chen-Yu Tsai <wenst@...omium.org>
but
> ---
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 11 +++++++++++
> drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 2 ++
> 2 files changed, 13 insertions(+)
>
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> index 6f8dfa6ae5a0..007da39b68c9 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> @@ -1115,3 +1115,14 @@ int mtk_pctrl_init(struct platform_device *pdev,
> gpiochip_remove(pctl->chip);
> return ret;
> }
> +
> +int mtk_pctrl_common_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + const struct mtk_pinctrl_devdata *data = device_get_match_data(dev);
> +
> + if (!data)
> + return -ENOENT;
This is probably bikeshedding, but it seems most other drivers use -ENODEV
or -EINVAL. -ENOENT is seldomly used in this context.
ChenYu
Powered by blists - more mailing lists