public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: sm501: Remove unused sm501_find_clock
@ 2025-05-08  0:22 linux
  2025-05-09 14:29 ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: linux @ 2025-05-08  0:22 UTC (permalink / raw)
  To: lee; +Cc: linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

sm501_find_clock() was added in 2007 as part of
commit b6d6454fdb66 ("[PATCH] mfd: SM501 core driver")
but hasn't been used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/mfd/sm501.c | 43 -------------------------------------------
 1 file changed, 43 deletions(-)

diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index 7ee293b09f62..bdeea0047e1b 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -631,49 +631,6 @@ unsigned long sm501_set_clock(struct device *dev,
 
 EXPORT_SYMBOL_GPL(sm501_set_clock);
 
-/* sm501_find_clock
- *
- * finds the closest available frequency for a given clock
-*/
-
-unsigned long sm501_find_clock(struct device *dev,
-			       int clksrc,
-			       unsigned long req_freq)
-{
-	struct sm501_devdata *sm = dev_get_drvdata(dev);
-	unsigned long sm501_freq; /* the frequency achieveable by the 501 */
-	struct sm501_clock to;
-
-	switch (clksrc) {
-	case SM501_CLOCK_P2XCLK:
-		if (sm->rev >= 0xC0) {
-			/* SM502 -> use the programmable PLL */
-			sm501_freq = (sm501_calc_pll(2 * req_freq,
-						     &to, 5) / 2);
-		} else {
-			sm501_freq = (sm501_select_clock(2 * req_freq,
-							 &to, 5) / 2);
-		}
-		break;
-
-	case SM501_CLOCK_V2XCLK:
-		sm501_freq = (sm501_select_clock(2 * req_freq, &to, 3) / 2);
-		break;
-
-	case SM501_CLOCK_MCLK:
-	case SM501_CLOCK_M1XCLK:
-		sm501_freq = sm501_select_clock(req_freq, &to, 3);
-		break;
-
-	default:
-		sm501_freq = 0;		/* error */
-	}
-
-	return sm501_freq;
-}
-
-EXPORT_SYMBOL_GPL(sm501_find_clock);
-
 static struct sm501_device *to_sm_device(struct platform_device *pdev)
 {
 	return container_of(pdev, struct sm501_device, pdev);
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: sm501: Remove unused sm501_find_clock
  2025-05-08  0:22 [PATCH] mfd: sm501: Remove unused sm501_find_clock linux
@ 2025-05-09 14:29 ` Lee Jones
  2025-05-09 17:36   ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2025-05-09 14:29 UTC (permalink / raw)
  To: linux; +Cc: linux-kernel

On Thu, 08 May 2025, linux@treblig.org wrote:

> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> sm501_find_clock() was added in 2007 as part of
> commit b6d6454fdb66 ("[PATCH] mfd: SM501 core driver")
> but hasn't been used.
> 
> Remove it.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
>  drivers/mfd/sm501.c | 43 -------------------------------------------

Looks like you missed: include/linux/sm501.h.

>  1 file changed, 43 deletions(-)
> 
> diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
> index 7ee293b09f62..bdeea0047e1b 100644
> --- a/drivers/mfd/sm501.c
> +++ b/drivers/mfd/sm501.c
> @@ -631,49 +631,6 @@ unsigned long sm501_set_clock(struct device *dev,
>  
>  EXPORT_SYMBOL_GPL(sm501_set_clock);
>  
> -/* sm501_find_clock
> - *
> - * finds the closest available frequency for a given clock
> -*/
> -
> -unsigned long sm501_find_clock(struct device *dev,
> -			       int clksrc,
> -			       unsigned long req_freq)
> -{
> -	struct sm501_devdata *sm = dev_get_drvdata(dev);
> -	unsigned long sm501_freq; /* the frequency achieveable by the 501 */
> -	struct sm501_clock to;
> -
> -	switch (clksrc) {
> -	case SM501_CLOCK_P2XCLK:
> -		if (sm->rev >= 0xC0) {
> -			/* SM502 -> use the programmable PLL */
> -			sm501_freq = (sm501_calc_pll(2 * req_freq,
> -						     &to, 5) / 2);
> -		} else {
> -			sm501_freq = (sm501_select_clock(2 * req_freq,
> -							 &to, 5) / 2);
> -		}
> -		break;
> -
> -	case SM501_CLOCK_V2XCLK:
> -		sm501_freq = (sm501_select_clock(2 * req_freq, &to, 3) / 2);
> -		break;
> -
> -	case SM501_CLOCK_MCLK:
> -	case SM501_CLOCK_M1XCLK:
> -		sm501_freq = sm501_select_clock(req_freq, &to, 3);
> -		break;
> -
> -	default:
> -		sm501_freq = 0;		/* error */
> -	}
> -
> -	return sm501_freq;
> -}
> -
> -EXPORT_SYMBOL_GPL(sm501_find_clock);
> -
>  static struct sm501_device *to_sm_device(struct platform_device *pdev)
>  {
>  	return container_of(pdev, struct sm501_device, pdev);
> -- 
> 2.49.0
> 

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: sm501: Remove unused sm501_find_clock
  2025-05-09 14:29 ` Lee Jones
@ 2025-05-09 17:36   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2025-05-09 17:36 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel

* Lee Jones (lee@kernel.org) wrote:
> On Thu, 08 May 2025, linux@treblig.org wrote:
> 
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > 
> > sm501_find_clock() was added in 2007 as part of
> > commit b6d6454fdb66 ("[PATCH] mfd: SM501 core driver")
> > but hasn't been used.
> > 
> > Remove it.
> > 
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> > ---
> >  drivers/mfd/sm501.c | 43 -------------------------------------------
> 
> Looks like you missed: include/linux/sm501.h.

Oops! Sorry about that, v2 posted; message id 20250509173521.49596-1-linux@treblig.org

Thanks for the review,

Dave

> >  1 file changed, 43 deletions(-)
> > 
> > diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
> > index 7ee293b09f62..bdeea0047e1b 100644
> > --- a/drivers/mfd/sm501.c
> > +++ b/drivers/mfd/sm501.c
> > @@ -631,49 +631,6 @@ unsigned long sm501_set_clock(struct device *dev,
> >  
> >  EXPORT_SYMBOL_GPL(sm501_set_clock);
> >  
> > -/* sm501_find_clock
> > - *
> > - * finds the closest available frequency for a given clock
> > -*/
> > -
> > -unsigned long sm501_find_clock(struct device *dev,
> > -			       int clksrc,
> > -			       unsigned long req_freq)
> > -{
> > -	struct sm501_devdata *sm = dev_get_drvdata(dev);
> > -	unsigned long sm501_freq; /* the frequency achieveable by the 501 */
> > -	struct sm501_clock to;
> > -
> > -	switch (clksrc) {
> > -	case SM501_CLOCK_P2XCLK:
> > -		if (sm->rev >= 0xC0) {
> > -			/* SM502 -> use the programmable PLL */
> > -			sm501_freq = (sm501_calc_pll(2 * req_freq,
> > -						     &to, 5) / 2);
> > -		} else {
> > -			sm501_freq = (sm501_select_clock(2 * req_freq,
> > -							 &to, 5) / 2);
> > -		}
> > -		break;
> > -
> > -	case SM501_CLOCK_V2XCLK:
> > -		sm501_freq = (sm501_select_clock(2 * req_freq, &to, 3) / 2);
> > -		break;
> > -
> > -	case SM501_CLOCK_MCLK:
> > -	case SM501_CLOCK_M1XCLK:
> > -		sm501_freq = sm501_select_clock(req_freq, &to, 3);
> > -		break;
> > -
> > -	default:
> > -		sm501_freq = 0;		/* error */
> > -	}
> > -
> > -	return sm501_freq;
> > -}
> > -
> > -EXPORT_SYMBOL_GPL(sm501_find_clock);
> > -
> >  static struct sm501_device *to_sm_device(struct platform_device *pdev)
> >  {
> >  	return container_of(pdev, struct sm501_device, pdev);
> > -- 
> > 2.49.0
> > 
> 
> -- 
> Lee Jones [李琼斯]
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-09 17:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-08  0:22 [PATCH] mfd: sm501: Remove unused sm501_find_clock linux
2025-05-09 14:29 ` Lee Jones
2025-05-09 17:36   ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox