lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7a0f0452-aa0e-4c2b-889e-312720d6f527@vivo.com>
Date: Mon, 26 Aug 2024 09:55:00 +0800
From: Rong Qianfeng <11065417@...o.com>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: biju.das.jz@...renesas.com,
 Wolfram Sang <wsa+renesas@...g-engineering.com>,
 Andi Shyti <andi.shyti@...nel.org>, Paul Cercueil <paul@...pouillou.net>,
 linux-renesas-soc@...r.kernel.org, linux-i2c@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
 opensource.kernel@...o.com, Rong Qianfeng <rongqianfeng@...o.com>
Subject: Re: [PATCH v3 4/4] i2c: jz4780: Use dev_err_probe()


在 2024/8/23 23:36, Andy Shevchenko 写道:
> [Some people who received this message don't often get email from andriy.shevchenko@...el.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> On Fri, Aug 23, 2024 at 11:51:16AM +0800, Rong Qianfeng wrote:
>> No more special handling needed here, so use dev_err_probe()
>> to simplify the code.
> Ah, okay. But see below.
>
> ...
>
>>        ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
>>                                   &clk_freq);
>> -     if (ret) {
>> -             dev_err(&pdev->dev, "clock-frequency not specified in DT\n");
>> -             return ret;
>> -     }
>> +     if (ret)
>> +             return dev_err_probe(&pdev->dev, ret,
>> +                                     "clock-frequency not specified in DT\n");
> Besides converting to the i2c_timings and respective APIs...
>
>>        i2c->speed = clk_freq / 1000;
>> -     if (i2c->speed == 0) {
>> -             ret = -EINVAL;
>> -             dev_err(&pdev->dev, "clock-frequency minimum is 1000\n");
>> -             return ret;
>> -     }
>> +     if (i2c->speed == 0)
>> +             return dev_err_probe(&pdev->dev, -EINVAL,
>> +                                     "clock-frequency minimum is 1000\n");
> ...this makes sense to do with
>
>          struct device *dev = &pdev->dev;
>          ...
>                  return dev_err_probe(dev, ...);
>
> And continue with a patch to replace all those &pdev->dev with dev.

Thanks very much for the detailed comments, I will modify all your 
suggestions in the next version.

Best Regards,
Qianfeng
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ