* [PATCH 1/2] mfd: arizona: Simplify with spi_get_device_match_data()
@ 2024-06-06 14:24 Krzysztof Kozlowski
2024-06-06 14:24 ` [PATCH 2/2] mfd: madera: " Krzysztof Kozlowski
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-06 14:24 UTC (permalink / raw)
To: Lee Jones, Charles Keepax, Richard Fitzgerald, patches,
linux-kernel, alsa-devel
Cc: Krzysztof Kozlowski
Use spi_get_device_match_data() helper to simplify a bit the driver.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/mfd/arizona-spi.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
index de5d894ac04a..eaa2b2bc5dd0 100644
--- a/drivers/mfd/arizona-spi.c
+++ b/drivers/mfd/arizona-spi.c
@@ -190,19 +190,12 @@ static int arizona_spi_acpi_probe(struct arizona *arizona)
static int arizona_spi_probe(struct spi_device *spi)
{
- const struct spi_device_id *id = spi_get_device_id(spi);
- const void *match_data;
struct arizona *arizona;
const struct regmap_config *regmap_config = NULL;
unsigned long type = 0;
int ret;
- match_data = device_get_match_data(&spi->dev);
- if (match_data)
- type = (unsigned long)match_data;
- else if (id)
- type = id->driver_data;
-
+ type = (unsigned long)spi_get_device_match_data(spi);
switch (type) {
case WM5102:
if (IS_ENABLED(CONFIG_MFD_WM5102))
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] mfd: madera: Simplify with spi_get_device_match_data()
2024-06-06 14:24 [PATCH 1/2] mfd: arizona: Simplify with spi_get_device_match_data() Krzysztof Kozlowski
@ 2024-06-06 14:24 ` Krzysztof Kozlowski
2024-06-10 15:13 ` Charles Keepax
2024-06-10 15:13 ` [PATCH 1/2] mfd: arizona: " Charles Keepax
2024-06-13 17:10 ` Lee Jones
2 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-06 14:24 UTC (permalink / raw)
To: Lee Jones, Charles Keepax, Richard Fitzgerald, patches,
linux-kernel, alsa-devel
Cc: Krzysztof Kozlowski
Use spi_get_device_match_data() helper to simplify a bit the driver.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/mfd/madera-spi.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/mfd/madera-spi.c b/drivers/mfd/madera-spi.c
index ad07ebe29e59..ce9e90322c9c 100644
--- a/drivers/mfd/madera-spi.c
+++ b/drivers/mfd/madera-spi.c
@@ -18,21 +18,14 @@
static int madera_spi_probe(struct spi_device *spi)
{
- const struct spi_device_id *id = spi_get_device_id(spi);
struct madera *madera;
const struct regmap_config *regmap_16bit_config = NULL;
const struct regmap_config *regmap_32bit_config = NULL;
- const void *of_data;
unsigned long type;
const char *name;
int ret;
- of_data = of_device_get_match_data(&spi->dev);
- if (of_data)
- type = (unsigned long)of_data;
- else
- type = id->driver_data;
-
+ type = (unsigned long)spi_get_device_match_data(spi);
switch (type) {
case CS47L15:
if (IS_ENABLED(CONFIG_MFD_CS47L15)) {
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 2/2] mfd: madera: Simplify with spi_get_device_match_data()
2024-06-06 14:24 ` [PATCH 2/2] mfd: madera: " Krzysztof Kozlowski
@ 2024-06-10 15:13 ` Charles Keepax
0 siblings, 0 replies; 5+ messages in thread
From: Charles Keepax @ 2024-06-10 15:13 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Lee Jones, Richard Fitzgerald, patches, linux-kernel, alsa-devel
On Thu, Jun 06, 2024 at 04:24:57PM +0200, Krzysztof Kozlowski wrote:
> Use spi_get_device_match_data() helper to simplify a bit the driver.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mfd: arizona: Simplify with spi_get_device_match_data()
2024-06-06 14:24 [PATCH 1/2] mfd: arizona: Simplify with spi_get_device_match_data() Krzysztof Kozlowski
2024-06-06 14:24 ` [PATCH 2/2] mfd: madera: " Krzysztof Kozlowski
@ 2024-06-10 15:13 ` Charles Keepax
2024-06-13 17:10 ` Lee Jones
2 siblings, 0 replies; 5+ messages in thread
From: Charles Keepax @ 2024-06-10 15:13 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Lee Jones, Richard Fitzgerald, patches, linux-kernel, alsa-devel
On Thu, Jun 06, 2024 at 04:24:56PM +0200, Krzysztof Kozlowski wrote:
> Use spi_get_device_match_data() helper to simplify a bit the driver.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mfd: arizona: Simplify with spi_get_device_match_data()
2024-06-06 14:24 [PATCH 1/2] mfd: arizona: Simplify with spi_get_device_match_data() Krzysztof Kozlowski
2024-06-06 14:24 ` [PATCH 2/2] mfd: madera: " Krzysztof Kozlowski
2024-06-10 15:13 ` [PATCH 1/2] mfd: arizona: " Charles Keepax
@ 2024-06-13 17:10 ` Lee Jones
2 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2024-06-13 17:10 UTC (permalink / raw)
To: Charles Keepax, Richard Fitzgerald, patches, linux-kernel,
alsa-devel, Krzysztof Kozlowski
On Thu, 06 Jun 2024 16:24:56 +0200, Krzysztof Kozlowski wrote:
> Use spi_get_device_match_data() helper to simplify a bit the driver.
>
>
Applied, thanks!
[1/2] mfd: arizona: Simplify with spi_get_device_match_data()
commit: 6cc27f7d3e26c6e661385c3cdbc554a8fefbdce5
[2/2] mfd: madera: Simplify with spi_get_device_match_data()
commit: 8385f6c81bb6042273a6b6cf793424b309ec8f2b
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-06-13 17:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 14:24 [PATCH 1/2] mfd: arizona: Simplify with spi_get_device_match_data() Krzysztof Kozlowski
2024-06-06 14:24 ` [PATCH 2/2] mfd: madera: " Krzysztof Kozlowski
2024-06-10 15:13 ` Charles Keepax
2024-06-10 15:13 ` [PATCH 1/2] mfd: arizona: " Charles Keepax
2024-06-13 17:10 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox