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: <b625df1f-9ddf-4eb1-8b51-6c63fac36530@vivo.com>
Date: Mon, 26 Aug 2024 11:03:20 +0800
From: Rong Qianfeng <11065417@...o.com>
To: Andy Shevchenko <andriy.shevchenko@...el.com>,
 Rong Qianfeng <rongqianfeng@...o.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
Subject: Re: [PATCH v3 3/4] i2c: jz4780: Use devm_clk_get_enabled() helpers


在 2024/8/23 23:33, 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:15AM +0800, Rong Qianfeng wrote:
>> The devm_clk_get_enabled() helpers:
>>      - call devm_clk_get()
>>      - call clk_prepare_enable() and register what is needed in order to
>>       call clk_disable_unprepare() when needed, as a managed resource.
>>
>> This simplifies the code and avoids the calls to clk_disable_unprepare().
>>
>> While at it, no more special handling needed here, remove the goto
>> label "err:".
> ...
>
>>        ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
>>                                   &clk_freq);
> (side note: this driver should use i2c_timings and respective I2C core
> APIs instead of this)
Sorry, I didn't fully understand what you meant, it's my problem. I guess
you are suggesting to use an API like i2c_parse_fw_timings() to get the
clock-frequency?


Best Regards,
Qianfeng
>
>>        if (ret) {
>>                dev_err(&pdev->dev, "clock-frequency not specified in DT\n");
>> -             goto err;
>> +             return ret;
> While at it,
>
>                  return dev_err_probe(...);
>
>>        }
>>        i2c->speed = clk_freq / 1000;
> (side note: this should be HZ_PER_KHZ from units.h)
>
>>        if (i2c->speed == 0) {
>>                ret = -EINVAL;
>>                dev_err(&pdev->dev, "clock-frequency minimum is 1000\n");
>> -             goto err;
>> +             return ret;
>                  return dev_err_probe(...);
>
>>        }
> ...
>
>>        ret = platform_get_irq(pdev, 0);
>>        if (ret < 0)
>> -             goto err;
>> +             return ret;
>>        i2c->irq = ret;
> I would add a blank line here.
>
>>        ret = devm_request_irq(&pdev->dev, i2c->irq, jz4780_i2c_irq, 0,
>>                               dev_name(&pdev->dev), i2c);
>>        if (ret)
>> -             goto err;
>> +             return ret;
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ