Skip to contentSkip to conversation

mmc: tmio: Remove obsolete callbacks

PATCH In review Geert Uytterhoeven 6 participants 16 messages Jun 20, 2024 – Jun 24, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover mmc: tmio: Remove obsolete callbacks

Hi all,

This patch series removes two unused callbacks from the tmio_mmc_data structure, and related infrastructure code.
- The first patch touches only the MFD subsystem.
- The second patch touches both the MMC and MFD subsystems, and has a contextual dependency on the first patch. If really needed, it can be split in an MMC and MFD part, but the MFD part depends on the MMC part anyway.

Thanks for your comments!

Geert Uytterhoeven (2):
mfd: tmio: Remove obsolete .set_clk_div() callback
mmc: tmio: Remove obsolete .set_pwr() callback()

 drivers/mmc/host/tmio_mmc.h      | 3 ---
 drivers/mmc/host/tmio_mmc_core.c | 8 --------
 include/linux/mfd/tmio.h         | 2 --
 3 files changed, 13 deletions(-)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
#1 lore raw

PATCH 1/2 mfd: tmio: Remove obsolete .set_clk_div() callback

Commit bef64d2908e825c5 ("mmc: remove tmio_mmc driver") removed the last user of the .set_clk_div() callback in the tmio_mmc_data structure.

---
 include/linux/mfd/tmio.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/mfd/tmio.h +0 -1
index eace8ea6cda05a3d..aca74ac1ff69e6f7 100644
@@ -101,7 +101,6 @@ struct tmio_mmc_data {
 	unsigned int			max_blk_count;
 	unsigned short			max_segs;
 	void (*set_pwr)(struct platform_device *host, int state);
-	void (*set_clk_div)(struct platform_device *host, int state);
 };
 
 /*
Signature · 1 line
2.34.1
maintainer
#2 lore raw

Re: [PATCH 1/2] mfd: tmio: Remove obsolete .set_clk_div() callback

Quoted 13 lines · Geert Uytterhoeven

Commit bef64d2908e825c5 ("mmc: remove tmio_mmc driver") removed the last user of the .set_clk_div() callback in the tmio_mmc_data structure.

---
 include/linux/mfd/tmio.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/mfd/tmio.h +0 -0
index eace8ea6cda05a3d..aca74ac1ff69e6f7 100644

include/linux/mfd/tmio.h struct tmio_mmc_data { · line 104

Quoted 4 lines
include/linux/mfd/tmio.h +0 -1
@@ -101,7 +101,6 @@ struct tmio_mmc_data {
 	unsigned int			max_blk_count;
 	unsigned short			max_segs;
 	void (*set_pwr)(struct platform_device *host, int state);
-	void (*set_clk_div)(struct platform_device *host, int state);

Any ramifications for just hoovering this up?

Signature · 1 line
Lee Jones [李琼斯]
#3 lore raw

Re: [PATCH 1/2] mfd: tmio: Remove obsolete .set_clk_div() callback

Hi Lee,

Quoted 9 lines · Lee Jones
Quoted 8 lines · Geert Uytterhoeven

Commit bef64d2908e825c5 ("mmc: remove tmio_mmc driver") removed the last user of the .set_clk_div() callback in the tmio_mmc_data structure.

---
 include/linux/mfd/tmio.h | 1 -
 1 file changed, 1 deletion(-)
Quoted 11 lines

include/linux/mfd/tmio.h struct tmio_mmc_data { · line 104

Quoted 9 lines
include/linux/mfd/tmio.h +0 -1
index eace8ea6cda05a3d..aca74ac1ff69e6f7 100644
@@ -101,7 +101,6 @@ struct tmio_mmc_data {
      unsigned int                    max_blk_count;
      unsigned short                  max_segs;
      void (*set_pwr)(struct platform_device *host, int state);
-     void (*set_clk_div)(struct platform_device *host, int state);

Any ramifications for just hoovering this up?

I am sorry, I am not familiar with that expression. Can you please elaborate?
Thanks!

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer
#4 lore raw

Re: [PATCH 1/2] mfd: tmio: Remove obsolete .set_clk_div() callback

Quoted 24 lines · Geert Uytterhoeven

Hi Lee,

Quoted 9 lines · Lee Jones
Quoted 8 lines · Geert Uytterhoeven

Commit bef64d2908e825c5 ("mmc: remove tmio_mmc driver") removed the last user of the .set_clk_div() callback in the tmio_mmc_data structure.

---
 include/linux/mfd/tmio.h | 1 -
 1 file changed, 1 deletion(-)
Quoted 11 lines

include/linux/mfd/tmio.h struct tmio_mmc_data { · line 104

Quoted 9 lines
include/linux/mfd/tmio.h +0 -1
index eace8ea6cda05a3d..aca74ac1ff69e6f7 100644
@@ -101,7 +101,6 @@ struct tmio_mmc_data {
      unsigned int                    max_blk_count;
      unsigned short                  max_segs;
      void (*set_pwr)(struct platform_device *host, int state);
-     void (*set_clk_div)(struct platform_device *host, int state);

Any ramifications for just hoovering this up?

Quoted 3 lines

I am sorry, I am not familiar with that expression. Can you please elaborate?
Thanks!

If I take _only_ this patch and leave the MMC one, will something break?

Signature · 1 line
Lee Jones [李琼斯]
#5 lore raw

Re: [PATCH 1/2] mfd: tmio: Remove obsolete .set_clk_div() callback

Hi Lee,

Quoted 23 lines · Lee Jones
Quoted 22 lines · Geert Uytterhoeven
Quoted 20 lines · Lee Jones
Quoted 13 lines · Geert Uytterhoeven

Commit bef64d2908e825c5 ("mmc: remove tmio_mmc driver") removed the last user of the .set_clk_div() callback in the tmio_mmc_data structure.

---
 include/linux/mfd/tmio.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/mfd/tmio.h +0 -0
index eace8ea6cda05a3d..aca74ac1ff69e6f7 100644

include/linux/mfd/tmio.h struct tmio_mmc_data { · line 104

Quoted 4 lines
include/linux/mfd/tmio.h +0 -1
@@ -101,7 +101,6 @@ struct tmio_mmc_data {
      unsigned int                    max_blk_count;
      unsigned short                  max_segs;
      void (*set_pwr)(struct platform_device *host, int state);
-     void (*set_clk_div)(struct platform_device *host, int state);

Any ramifications for just hoovering this up?

Quoted 5 lines
Quoted 3 lines

I am sorry, I am not familiar with that expression. Can you please elaborate?
Thanks!

If I take _only_ this patch and leave the MMC one, will something break?

No, nothing will break.

It will just (a) make it a tad more difficult to apply the second patch to the MMC tree, as it has a contextual dependency on the first patch, and (b) cause a merge conflict for linux-next and Linus later... Perhaps it would be easier to just provide an Acked-by, like you have already done for the second patch?

Thanks!

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer Acked-by
#6 lore raw

Re: [PATCH 1/2] mfd: tmio: Remove obsolete .set_clk_div() callback

Quoted 32 lines · Geert Uytterhoeven

Hi Lee,

Quoted 23 lines · Lee Jones
Quoted 22 lines · Geert Uytterhoeven
Quoted 20 lines · Lee Jones
Quoted 13 lines · Geert Uytterhoeven

Commit bef64d2908e825c5 ("mmc: remove tmio_mmc driver") removed the last user of the .set_clk_div() callback in the tmio_mmc_data structure.

---
 include/linux/mfd/tmio.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/mfd/tmio.h +0 -0
index eace8ea6cda05a3d..aca74ac1ff69e6f7 100644

include/linux/mfd/tmio.h struct tmio_mmc_data { · line 104

Quoted 4 lines
include/linux/mfd/tmio.h +0 -1
@@ -101,7 +101,6 @@ struct tmio_mmc_data {
      unsigned int                    max_blk_count;
      unsigned short                  max_segs;
      void (*set_pwr)(struct platform_device *host, int state);
-     void (*set_clk_div)(struct platform_device *host, int state);

Any ramifications for just hoovering this up?

Quoted 5 lines
Quoted 3 lines

I am sorry, I am not familiar with that expression. Can you please elaborate?
Thanks!

If I take _only_ this patch and leave the MMC one, will something break?

Quoted 7 lines

No, nothing will break.

It will just (a) make it a tad more difficult to apply the second patch to the MMC tree, as it has a contextual dependency on the first patch, and (b) cause a merge conflict for linux-next and Linus later... Perhaps it would be easier to just provide an Acked-by, like you have already done for the second patch?

Considering this is only a one-liner, this should be okay.

Signature · 1 line
Lee Jones [李琼斯]
Reviewed-by Lad Prabhakar on v1 1/2
#9 lore raw

Re: [PATCH 1/2] mfd: tmio: Remove obsolete .set_clk_div() callback

In reply to Geert Uytterhoeven
Quoted 9 lines · Geert Uytterhoeven

Commit bef64d2908e825c5 ("mmc: remove tmio_mmc driver") removed the last user of the .set_clk_div() callback in the tmio_mmc_data structure.

---
 include/linux/mfd/tmio.h | 1 -
 1 file changed, 1 deletion(-)

Cheers,
Prabhakar

Quoted 16 lines
include/linux/mfd/tmio.h +0 -2
index eace8ea6cda05a3d..aca74ac1ff69e6f7 100644
@@ -101,7 +101,6 @@ struct tmio_mmc_data {
        unsigned int                    max_blk_count;
        unsigned short                  max_segs;
        void (*set_pwr)(struct platform_device *host, int state);
-       void (*set_clk_div)(struct platform_device *host, int state);
 };
 
 /*
--

2.34.1

#10 lore raw

PATCH 2/2 mmc: tmio: Remove obsolete .set_pwr() callback()

In reply to Geert Uytterhoeven

Commit ca78476e4888f1f1 ("mfd: Remove toshiba tmio drivers") removed the last users of the .set_pwr() callback in the tmio_mmc_data structure. Remove the callback, and all related infrastructure.

---
Laurent tried this before in commit 3af9d15c719017fe ("mmc: tmio-mmc: Remove .set_pwr() callback from platform data"), but it had to be reverted in commit 9d731e7539713acc ("Revert "mmc: tmio-mmc: Remove .set_pwr() callback from platform data"") because there were still users at that time.

---
 drivers/mmc/host/tmio_mmc.h      | 3 ---
 drivers/mmc/host/tmio_mmc_core.c | 8 --------
 include/linux/mfd/tmio.h         | 1 -
 3 files changed, 12 deletions(-)
drivers/mmc/host/tmio_mmc.h +0 -3
index de56e6534aeaaa10..2af5730c21f4a98d 100644
@@ -139,9 +139,6 @@ struct tmio_mmc_host {
 	struct mmc_host         *mmc;
 	struct mmc_host_ops     ops;
 
-	/* Callbacks for clock / power control */
-	void (*set_pwr)(struct platform_device *host, int state);
-
 	/* pio related stuff */
 	struct scatterlist      *sg_ptr;
 	struct scatterlist      *sg_orig;
drivers/mmc/host/tmio_mmc_core.c +0 -8
index 93e912afd3ae5aa0..7b4256f0cbe77028 100644
@@ -880,9 +880,6 @@ static void tmio_mmc_power_on(struct tmio_mmc_host *host, unsigned short vdd)
 
 	/* .set_ios() is returning void, so, no chance to report an error */
 
-	if (host->set_pwr)
-		host->set_pwr(host->pdev, 1);
-
 	if (!IS_ERR(mmc->supply.vmmc)) {
 		ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
 		/*
@@ -916,9 +913,6 @@ static void tmio_mmc_power_off(struct tmio_mmc_host *host)
 
 	if (!IS_ERR(mmc->supply.vmmc))
 		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
-
-	if (host->set_pwr)
-		host->set_pwr(host->pdev, 0);
 }
 
 static unsigned int tmio_mmc_get_timeout_cycles(struct tmio_mmc_host *host)
@@ -1160,8 +1154,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
 	if (pdata->flags & TMIO_MMC_USE_BUSY_TIMEOUT && !_host->get_timeout_cycles)
 		_host->get_timeout_cycles = tmio_mmc_get_timeout_cycles;
 
-	_host->set_pwr = pdata->set_pwr;
-
 	ret = tmio_mmc_init_ocr(_host);
 	if (ret < 0)
 		return ret;
include/linux/mfd/tmio.h +0 -1
index aca74ac1ff69e6f7..8c09d14a3a286ca0 100644
@@ -100,7 +100,6 @@ struct tmio_mmc_data {
 	dma_addr_t			dma_rx_offset;
 	unsigned int			max_blk_count;
 	unsigned short			max_segs;
-	void (*set_pwr)(struct platform_device *host, int state);
 };
 
 /*
Signature · 1 line
2.34.1
maintainer Acked-by on v1 2/2
#11 lore raw

Re: [PATCH 2/2] mmc: tmio: Remove obsolete .set_pwr() callback()

Quoted 11 lines · Geert Uytterhoeven

Commit ca78476e4888f1f1 ("mfd: Remove toshiba tmio drivers") removed the last users of the .set_pwr() callback in the tmio_mmc_data structure. Remove the callback, and all related infrastructure.

---
Laurent tried this before in commit 3af9d15c719017fe ("mmc: tmio-mmc: Remove .set_pwr() callback from platform data"), but it had to be reverted in commit 9d731e7539713acc ("Revert "mmc: tmio-mmc: Remove .set_pwr() callback from platform data"") because there were still users at that time.

Quoted 4 lines
---
 drivers/mmc/host/tmio_mmc.h      | 3 ---
 drivers/mmc/host/tmio_mmc_core.c | 8 --------
 include/linux/mfd/tmio.h         | 1 -
Signature · 1 line
Lee Jones [李琼斯]
maintainer Reviewed-by on v1 2/2
#12 lore raw

Re: [PATCH 2/2] mmc: tmio: Remove obsolete .set_pwr() callback()

In reply to Geert Uytterhoeven
Quoted 5 lines · Geert Uytterhoeven

Commit ca78476e4888f1f1 ("mfd: Remove toshiba tmio drivers") removed the last users of the .set_pwr() callback in the tmio_mmc_data structure. Remove the callback, and all related infrastructure.

Cool, I had the gut feeling that more cleanups were possible after the plain TMIO drivers were removed.

maintainer Tested-by
#13 lore raw

Re: [PATCH 2/2] mmc: tmio: Remove obsolete .set_pwr() callback()

Quoted 8 lines · Wolfram Sang
Quoted 5 lines · Geert Uytterhoeven

Commit ca78476e4888f1f1 ("mfd: Remove toshiba tmio drivers") removed the last users of the .set_pwr() callback in the tmio_mmc_data structure. Remove the callback, and all related infrastructure.

Also:

Reviewed-by Lad Prabhakar on v1 2/2
#14 lore raw

Re: [PATCH 2/2] mmc: tmio: Remove obsolete .set_pwr() callback()

In reply to Geert Uytterhoeven
Quoted 12 lines · Geert Uytterhoeven

Commit ca78476e4888f1f1 ("mfd: Remove toshiba tmio drivers") removed the last users of the .set_pwr() callback in the tmio_mmc_data structure. Remove the callback, and all related infrastructure.

---
Laurent tried this before in commit 3af9d15c719017fe ("mmc: tmio-mmc: Remove .set_pwr() callback from platform data"), but it had to be reverted in commit 9d731e7539713acc ("Revert "mmc: tmio-mmc: Remove .set_pwr() callback from platform data"") because there were still users at that time.

Quoted 6 lines
---
 drivers/mmc/host/tmio_mmc.h      | 3 ---
 drivers/mmc/host/tmio_mmc_core.c | 8 --------
 include/linux/mfd/tmio.h         | 1 -
 3 files changed, 12 deletions(-)

Cheers,
Prabhakar

Quoted 63 lines
drivers/mmc/host/tmio_mmc.h +0 -3
index de56e6534aeaaa10..2af5730c21f4a98d 100644
@@ -139,9 +139,6 @@ struct tmio_mmc_host {
        struct mmc_host         *mmc;
        struct mmc_host_ops     ops;
 
-       /* Callbacks for clock / power control */
-       void (*set_pwr)(struct platform_device *host, int state);
-
        /* pio related stuff */
        struct scatterlist      *sg_ptr;
        struct scatterlist      *sg_orig;
drivers/mmc/host/tmio_mmc_core.c +0 -8
index 93e912afd3ae5aa0..7b4256f0cbe77028 100644
@@ -880,9 +880,6 @@ static void tmio_mmc_power_on(struct tmio_mmc_host *host, unsigned short vdd)
 
        /* .set_ios() is returning void, so, no chance to report an error */
 
-       if (host->set_pwr)
-               host->set_pwr(host->pdev, 1);
-
        if (!IS_ERR(mmc->supply.vmmc)) {
                ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
                /*
@@ -916,9 +913,6 @@ static void tmio_mmc_power_off(struct tmio_mmc_host *host)
 
        if (!IS_ERR(mmc->supply.vmmc))
                mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
-
-       if (host->set_pwr)
-               host->set_pwr(host->pdev, 0);
 }
 
 static unsigned int tmio_mmc_get_timeout_cycles(struct tmio_mmc_host *host)
@@ -1160,8 +1154,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
        if (pdata->flags & TMIO_MMC_USE_BUSY_TIMEOUT && !_host->get_timeout_cycles)
                _host->get_timeout_cycles = tmio_mmc_get_timeout_cycles;
 
-       _host->set_pwr = pdata->set_pwr;
-
        ret = tmio_mmc_init_ocr(_host);
        if (ret < 0)
                return ret;
include/linux/mfd/tmio.h +0 -2
index aca74ac1ff69e6f7..8c09d14a3a286ca0 100644
@@ -100,7 +100,6 @@ struct tmio_mmc_data {
        dma_addr_t                      dma_rx_offset;
        unsigned int                    max_blk_count;
        unsigned short                  max_segs;
-       void (*set_pwr)(struct platform_device *host, int state);
 };
 
 /*
--

2.34.1

#15 lore raw
In reply to Geert Uytterhoeven
Quoted 17 lines · Geert Uytterhoeven

Hi all,

This patch series removes two unused callbacks from the tmio_mmc_data structure, and related infrastructure code.
- The first patch touches only the MFD subsystem.
- The second patch touches both the MMC and MFD subsystems, and has a contextual dependency on the first patch. If really needed, it can be split in an MMC and MFD part, but the MFD part depends on the MMC part anyway.

Thanks for your comments!

Geert Uytterhoeven (2):
mfd: tmio: Remove obsolete .set_clk_div() callback
mmc: tmio: Remove obsolete .set_pwr() callback()

Quoted 6 lines
 drivers/mmc/host/tmio_mmc.h      | 3 ---
 drivers/mmc/host/tmio_mmc_core.c | 8 --------
 include/linux/mfd/tmio.h         | 2 --
 3 files changed, 13 deletions(-)

--

Applied for next, thanks!

Kind regards
Uffe