mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] drivers: pxa: don't define clk_enable/clk_disable with different prototype
@ 2023-11-23  8:14 Ahmad Fatoum
  2023-11-23 14:53 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-11-23  8:14 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Even on platforms without CCF support, clk_enable and clk_disable are
defined as stubs. Defining functions with the same name can thus clash
with these definitions, e.g. if <linux/clk.h> is included from a new
header. Fix this by renaming the functions.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Please order before
https://lore.barebox.org/barebox/20231122171320.1714868-1-a.fatoum@pengutronix.de/T/#t
---
 drivers/mci/pxamci.c                | 4 ++--
 drivers/usb/gadget/udc/pxa27x_udc.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mci/pxamci.c b/drivers/mci/pxamci.c
index 8d8e9e88bb5c..5df1ef5cb6fb 100644
--- a/drivers/mci/pxamci.c
+++ b/drivers/mci/pxamci.c
@@ -26,7 +26,7 @@
 #define TX_TIMEOUT (250 * MSECOND)
 #define CMD_TIMEOUT (100 * MSECOND)
 
-static void clk_enable(void)
+static void mmc_clk_enable(void)
 {
 	CKEN |= CKEN_MMC;
 }
@@ -334,7 +334,7 @@ static int pxamci_probe(struct device *dev)
 	struct pxamci_host *host;
 	int gpio_power = -1;
 
-	clk_enable();
+	mmc_clk_enable();
 	host = xzalloc(sizeof(*host));
 	iores = dev_request_mem_resource(dev, 0);
 	if (IS_ERR(iores))
diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index 67b7e28de9d2..20148f48783d 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -882,12 +882,12 @@ static const struct usb_gadget_ops pxa_udc_ops = {
 	.udc_poll	= pxa_udc_gadget_poll,
 };
 
-static void clk_enable(void)
+static void usb_clk_enable(void)
 {
 	CKEN |= CKEN_USB;
 }
 
-static void clk_disable(void)
+static void usb_clk_disable(void)
 {
 	CKEN &= ~CKEN_USB;
 }
@@ -901,7 +901,7 @@ static void udc_disable(struct pxa_udc *udc)
 	udc_writel(udc, UDCICR1, 0);
 
 	udc_clear_mask_UDCCR(udc, UDCCR_UDE);
-	clk_disable();
+	usb_clk_disable();
 
 	ep0_idle(udc);
 	udc->gadget.speed = USB_SPEED_UNKNOWN;
@@ -946,7 +946,7 @@ static void udc_enable(struct pxa_udc *udc)
 	udc_writel(udc, UDCICR1, 0);
 	udc_clear_mask_UDCCR(udc, UDCCR_UDE);
 
-	clk_enable();
+	usb_clk_enable();
 
 	ep0_idle(udc);
 	udc->gadget.speed = USB_SPEED_FULL;
-- 
2.39.2




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

* Re: [PATCH] drivers: pxa: don't define clk_enable/clk_disable with different prototype
  2023-11-23  8:14 [PATCH] drivers: pxa: don't define clk_enable/clk_disable with different prototype Ahmad Fatoum
@ 2023-11-23 14:53 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-11-23 14:53 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Thu, Nov 23, 2023 at 09:14:27AM +0100, Ahmad Fatoum wrote:
> Even on platforms without CCF support, clk_enable and clk_disable are
> defined as stubs. Defining functions with the same name can thus clash
> with these definitions, e.g. if <linux/clk.h> is included from a new
> header. Fix this by renaming the functions.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> Please order before
> https://lore.barebox.org/barebox/20231122171320.1714868-1-a.fatoum@pengutronix.de/T/#t
> ---
>  drivers/mci/pxamci.c                | 4 ++--
>  drivers/usb/gadget/udc/pxa27x_udc.c | 8 ++++----
>  2 files changed, 6 insertions(+), 6 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/mci/pxamci.c b/drivers/mci/pxamci.c
> index 8d8e9e88bb5c..5df1ef5cb6fb 100644
> --- a/drivers/mci/pxamci.c
> +++ b/drivers/mci/pxamci.c
> @@ -26,7 +26,7 @@
>  #define TX_TIMEOUT (250 * MSECOND)
>  #define CMD_TIMEOUT (100 * MSECOND)
>  
> -static void clk_enable(void)
> +static void mmc_clk_enable(void)
>  {
>  	CKEN |= CKEN_MMC;
>  }
> @@ -334,7 +334,7 @@ static int pxamci_probe(struct device *dev)
>  	struct pxamci_host *host;
>  	int gpio_power = -1;
>  
> -	clk_enable();
> +	mmc_clk_enable();
>  	host = xzalloc(sizeof(*host));
>  	iores = dev_request_mem_resource(dev, 0);
>  	if (IS_ERR(iores))
> diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
> index 67b7e28de9d2..20148f48783d 100644
> --- a/drivers/usb/gadget/udc/pxa27x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa27x_udc.c
> @@ -882,12 +882,12 @@ static const struct usb_gadget_ops pxa_udc_ops = {
>  	.udc_poll	= pxa_udc_gadget_poll,
>  };
>  
> -static void clk_enable(void)
> +static void usb_clk_enable(void)
>  {
>  	CKEN |= CKEN_USB;
>  }
>  
> -static void clk_disable(void)
> +static void usb_clk_disable(void)
>  {
>  	CKEN &= ~CKEN_USB;
>  }
> @@ -901,7 +901,7 @@ static void udc_disable(struct pxa_udc *udc)
>  	udc_writel(udc, UDCICR1, 0);
>  
>  	udc_clear_mask_UDCCR(udc, UDCCR_UDE);
> -	clk_disable();
> +	usb_clk_disable();
>  
>  	ep0_idle(udc);
>  	udc->gadget.speed = USB_SPEED_UNKNOWN;
> @@ -946,7 +946,7 @@ static void udc_enable(struct pxa_udc *udc)
>  	udc_writel(udc, UDCICR1, 0);
>  	udc_clear_mask_UDCCR(udc, UDCCR_UDE);
>  
> -	clk_enable();
> +	usb_clk_enable();
>  
>  	ep0_idle(udc);
>  	udc->gadget.speed = USB_SPEED_FULL;
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2023-11-23 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-23  8:14 [PATCH] drivers: pxa: don't define clk_enable/clk_disable with different prototype Ahmad Fatoum
2023-11-23 14:53 ` Sascha Hauer

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