[PATCH v4 02/13] mtd: spi-nor: Introduce spi_nor_set_mtd_info()
Tudor.Ambarus at microchip.com
Tudor.Ambarus at microchip.com
Fri Dec 3 04:03:52 PST 2021
On 12/2/21 11:19 AM, Pratyush Yadav wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On 22/11/21 11:50AM, Tudor Ambarus wrote:
>> Used to init all the mtd_info fields. Move the mtd_info init
>> the last thing in the spi_nor_scan(), so that we avoid superfluous
>> initialization of the mtd_info fields in case of errors.
>>
>> While here use common naming scheme for functions that are setting
>> mtd_info fields:
>> s/spi_nor_register_locking_ops/spi_nor_set_mtd_locking_ops
>> s/spi_nor_otp_init/spi_nor_set_mtd_otp_ops
>> The functions names are self explanatory, get rid of the comment
>> for the OTP function.
>>
>> Signed-off-by: Tudor Ambarus <tudor.ambarus at microchip.com>
>> Reviewed-by: Michael Walle <michael at walle.cc>
>
> I am not particularly happy with spi_nor_try_unlock_all() using
> nor->mtd, but I can live with it.
>
> Reviewed-by: Pratyush Yadav <p.yadav at ti.com>
>
> One small nitpick below.
>
>>
>> - /* Configure OTP parameters and ops */
>> - spi_nor_otp_init(nor);
>> + /* No mtd_info fields are used up to this point. */
>
> How about "No mtd_info fields should be used up to this point" so we
> give the programmer a command to not use mtd_info fields rather than
> just stating a fact.
ok, will do.
More information about the linux-mtd
mailing list