All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Michael Walle" <michael@walle.cc>,
	linux-mtd@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH v6.8 1/2] nvmem: layouts: refactor .add_cells() callback arguments
Date: Tue, 19 Dec 2023 13:55:53 +0100	[thread overview]
Message-ID: <20231219135553.4e1b74f4@xps-13> (raw)
In-Reply-To: <20231219120104.3422-1-zajec5@gmail.com>

Hi Rafał,

zajec5@gmail.com wrote on Tue, 19 Dec 2023 13:01:03 +0100:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Simply pass whole "struct nvmem_layout" instead of single variables.
> There is nothing in "struct nvmem_layout" that we have to hide from
> layout drivers. They also access it during .probe() and .remove().
> 
> Thanks to this change:
> 
> 1. API gets more consistent
>    All layouts drivers callbacks get the same argument
> 
> 2. Layouts get correct device
>    Before this change NVMEM core code was passing NVMEM device instead
>    of layout device. That resulted in:
>    * Confusing prints
>    * Calling devm_*() helpers on wrong device
>    * Helpers like of_device_get_match_data() dereferencing NULLs
> 
> 3. It gets possible to get match data
>    First of all nvmem_layout_get_match_data() requires passing "struct
>    nvmem_layout" which .add_cells() callback didn't have before this. It
>    doesn't matter much as it's rather useless now anyway (and will be
>    dropped).
>    What's more important however is that of_device_get_match_data() can
>    be used now thanks to owning a proper device pointer.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Michael Walle" <michael@walle.cc>,
	linux-mtd@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH v6.8 1/2] nvmem: layouts: refactor .add_cells() callback arguments
Date: Tue, 19 Dec 2023 13:55:53 +0100	[thread overview]
Message-ID: <20231219135553.4e1b74f4@xps-13> (raw)
In-Reply-To: <20231219120104.3422-1-zajec5@gmail.com>

Hi Rafał,

zajec5@gmail.com wrote on Tue, 19 Dec 2023 13:01:03 +0100:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Simply pass whole "struct nvmem_layout" instead of single variables.
> There is nothing in "struct nvmem_layout" that we have to hide from
> layout drivers. They also access it during .probe() and .remove().
> 
> Thanks to this change:
> 
> 1. API gets more consistent
>    All layouts drivers callbacks get the same argument
> 
> 2. Layouts get correct device
>    Before this change NVMEM core code was passing NVMEM device instead
>    of layout device. That resulted in:
>    * Confusing prints
>    * Calling devm_*() helpers on wrong device
>    * Helpers like of_device_get_match_data() dereferencing NULLs
> 
> 3. It gets possible to get match data
>    First of all nvmem_layout_get_match_data() requires passing "struct
>    nvmem_layout" which .add_cells() callback didn't have before this. It
>    doesn't matter much as it's rather useless now anyway (and will be
>    dropped).
>    What's more important however is that of_device_get_match_data() can
>    be used now thanks to owning a proper device pointer.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Michael Walle" <michael@walle.cc>,
	linux-mtd@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH v6.8 1/2] nvmem: layouts: refactor .add_cells() callback arguments
Date: Tue, 19 Dec 2023 13:55:53 +0100	[thread overview]
Message-ID: <20231219135553.4e1b74f4@xps-13> (raw)
In-Reply-To: <20231219120104.3422-1-zajec5@gmail.com>

Hi Rafał,

zajec5@gmail.com wrote on Tue, 19 Dec 2023 13:01:03 +0100:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Simply pass whole "struct nvmem_layout" instead of single variables.
> There is nothing in "struct nvmem_layout" that we have to hide from
> layout drivers. They also access it during .probe() and .remove().
> 
> Thanks to this change:
> 
> 1. API gets more consistent
>    All layouts drivers callbacks get the same argument
> 
> 2. Layouts get correct device
>    Before this change NVMEM core code was passing NVMEM device instead
>    of layout device. That resulted in:
>    * Confusing prints
>    * Calling devm_*() helpers on wrong device
>    * Helpers like of_device_get_match_data() dereferencing NULLs
> 
> 3. It gets possible to get match data
>    First of all nvmem_layout_get_match_data() requires passing "struct
>    nvmem_layout" which .add_cells() callback didn't have before this. It
>    doesn't matter much as it's rather useless now anyway (and will be
>    dropped).
>    What's more important however is that of_device_get_match_data() can
>    be used now thanks to owning a proper device pointer.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

  parent reply	other threads:[~2023-12-19 12:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19 12:01 [PATCH v6.8 1/2] nvmem: layouts: refactor .add_cells() callback arguments Rafał Miłecki
2023-12-19 12:01 ` Rafał Miłecki
2023-12-19 12:01 ` Rafał Miłecki
2023-12-19 12:01 ` [PATCH v6.8 2/2] nvmem: drop nvmem_layout_get_match_data() Rafał Miłecki
2023-12-19 12:01   ` Rafał Miłecki
2023-12-19 12:01   ` Rafał Miłecki
2023-12-19 12:21   ` Michael Walle
2023-12-19 12:21     ` Michael Walle
2023-12-19 12:21     ` Michael Walle
2023-12-19 12:33     ` Rafał Miłecki
2023-12-19 12:33       ` Rafał Miłecki
2023-12-19 12:33       ` Rafał Miłecki
2023-12-19 12:56   ` Miquel Raynal
2023-12-19 12:56     ` Miquel Raynal
2023-12-19 12:56     ` Miquel Raynal
2023-12-19 12:24 ` [PATCH v6.8 1/2] nvmem: layouts: refactor .add_cells() callback arguments Michael Walle
2023-12-19 12:24   ` Michael Walle
2023-12-19 12:24   ` Michael Walle
2023-12-19 12:55 ` Miquel Raynal [this message]
2023-12-19 12:55   ` Miquel Raynal
2023-12-19 12:55   ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231219135553.4e1b74f4@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=rafal@milecki.pl \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.