Re: [PATCH v2 22/35] mtd: spi-nor: core: Use common naming scheme for setting mtd_info fields

Tudor.Ambarus
2021-10-22T12:56:25Z

On 10/22/21 2:57 PM, Michael Walle wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> Am 2021-07-27 06:52, schrieb Tudor Ambarus:
>> The functions names are self explanatory, get rid of the comment
>> for the OTP function.
>
> Mhh. I see, this partly addresses my comments to the previous patch.
> Maybe it would have been better to have this squashed into one
> commit :p

one thing per patch

>
> But my main concern remains: what if we need more that just
> the mtd callbacks assigments. Basically we loose the otp_init()
> call.

if (WARN_ON(!is_power_of_2(spi_nor_otp_region_len(nor))))
return;

is there just to avoid setting the mtd function pointers when OTP
region length is not power of 2. This is not an init, just a check,
so for the moment I see it ok to have it in spi_nor_set_mtd_otp_ops().

If some OTP init is required we'll introduce it.