[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHTX3dK+M9eg+Xod9tYHiEXY_igjO6iocaO=e1Frqd1kzPKTrw@mail.gmail.com>
Date: Wed, 23 Jun 2021 10:57:35 +0200
From: Michal Simek <monstr@...str.eu>
To: Krzysztof Kozlowski <krzk@...nel.org>,
Wolfram Sang <wsa@...-dreams.de>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>,
Florian Fainelli <f.fainelli@...il.com>,
Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
bcm-kernel-feedback-list@...adcom.com,
Sekhar Nori <nsekhar@...com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Oleksij Rempel <linux@...pel-privat.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Heiko Stuebner <heiko@...ech.de>,
Pierre-Yves MORDRET <pierre-yves.mordret@...com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...com>,
Peter Rosin <peda@...ntia.se>, Wolfram Sang <wsa@...nel.org>,
linux-i2c@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
linux-arm <linux-arm-kernel@...ts.infradead.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-rockchip@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com
Subject: Re: [PATCH 2/9] i2c: xiic: Simplify with dev_err_probe()
st 2. 9. 2020 v 17:10 odesÃlatel Krzysztof Kozlowski <krzk@...nel.org> napsal:
>
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
> ---
> drivers/i2c/busses/i2c-xiic.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index 90c1c362394d..a97438f35c5d 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -787,11 +787,10 @@ static int xiic_i2c_probe(struct platform_device *pdev)
> init_waitqueue_head(&i2c->wait);
>
> i2c->clk = devm_clk_get(&pdev->dev, NULL);
> - if (IS_ERR(i2c->clk)) {
> - if (PTR_ERR(i2c->clk) != -EPROBE_DEFER)
> - dev_err(&pdev->dev, "input clock not found.\n");
> - return PTR_ERR(i2c->clk);
> - }
> + if (IS_ERR(i2c->clk))
> + return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
> + "input clock not found.\n");
> +
> ret = clk_prepare_enable(i2c->clk);
> if (ret) {
> dev_err(&pdev->dev, "Unable to enable clock.\n");
> --
> 2.17.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
I see that this didn't go through.
Acked-by: Michal Simek <michal.simek@...inx.com>
Wolfram: Can you please apply?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
Powered by blists - more mailing lists