]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mfd: sm501: Remove unused sm501_find_clock
authorDr. David Alan Gilbert <linux@treblig.org>
Fri, 9 May 2025 17:35:20 +0000 (18:35 +0100)
committerLee Jones <lee@kernel.org>
Fri, 23 May 2025 07:49:16 +0000 (08:49 +0100)
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>
Link: https://lore.kernel.org/r/20250509173521.49596-1-linux@treblig.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/sm501.c
include/linux/sm501.h

index 94ad18b52b83520256e5210d9beefe36db74f578..a5f9241fa3f2009ebc7fada7849736a51539ae36 100644 (file)
@@ -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);
index 2f3488b2875d01a1611ce815ce446e6b066f5cf2..bcda27a46e7ad28aafb04f503c6810c0609fea52 100644 (file)
@@ -12,9 +12,6 @@ extern int sm501_unit_power(struct device *dev,
 extern unsigned long sm501_set_clock(struct device *dev,
                                     int clksrc, unsigned long freq);
 
-extern unsigned long sm501_find_clock(struct device *dev,
-                                     int clksrc, unsigned long req_freq);
-
 /* sm501_misc_control
  *
  * Modify the SM501's MISC_CONTROL register