Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] staging: wilc1000: look for rtc_clk clock in spi mode
@ 2019-09-16 19:37 Adham.Abozaeid
  2019-09-17  0:49 ` kbuild test robot
  2019-09-17  7:11 ` Claudiu.Beznea
  0 siblings, 2 replies; 6+ messages in thread
From: Adham.Abozaeid @ 2019-09-16 19:37 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, johannes, Ajay.Kathat, Eugen.Hristev,
	Adham.Abozaeid

From: Adham Abozaeid <adham.abozaeid@microchip.com>

If rtc_clk is provided from DT, use it and enable it.
This is optional.
The signal may be hardcoded and no need to be requested,
but if DT provides it, use it.

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
---
 drivers/staging/wilc1000/wilc_spi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
index 3c1ae9e9f9aa..166455a969bf 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -4,6 +4,7 @@
  * All rights reserved.
  */
 
+#include <linux/clk.h>
 #include <linux/spi/spi.h>
 
 #include "wilc_wfi_netdevice.h"
@@ -132,6 +133,12 @@ static int wilc_bus_probe(struct spi_device *spi)
 	wilc->bus_data = spi_priv;
 	wilc->gpio_irq = gpio;
 
+	wilc->rtc_clk = devm_clk_get(&spi->dev, "rtc_clk");
+	if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER)
+		return -EPROBE_DEFER;
+	else if (!IS_ERR(wilc->rtc_clk))
+		clk_prepare_enable(wilc->rtc_clk);
+
 	return 0;
 }
 
@@ -142,6 +149,10 @@ static int wilc_bus_remove(struct spi_device *spi)
 	/* free the GPIO in module remove */
 	if (wilc->gpio_irq)
 		gpiod_put(wilc->gpio_irq);
+
+	if (!IS_ERR(wilc->rtc_clk))
+		clk_disable_unprepare(wilc->rtc_clk);
+
 	wilc_netdev_cleanup(wilc);
 	return 0;
 }
-- 
2.17.1


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

* Re: [PATCH] staging: wilc1000: look for rtc_clk clock in spi mode
  2019-09-16 19:37 [PATCH] staging: wilc1000: look for rtc_clk clock in spi mode Adham.Abozaeid
@ 2019-09-17  0:49 ` kbuild test robot
  2019-09-17  1:03   ` Adham.Abozaeid
  2019-09-17  7:11 ` Claudiu.Beznea
  1 sibling, 1 reply; 6+ messages in thread
From: kbuild test robot @ 2019-09-17  0:49 UTC (permalink / raw)
  To: Adham.Abozaeid
  Cc: kbuild-all, linux-wireless, devel, gregkh, johannes, Ajay.Kathat,
	Eugen.Hristev, Adham.Abozaeid

[-- Attachment #1: Type: text/plain, Size: 3396 bytes --]

Hi,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3 next-20190916]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Adham-Abozaeid-microchip-com/staging-wilc1000-look-for-rtc_clk-clock-in-spi-mode/20190917-033844
config: c6x-allyesconfig (attached as .config)
compiler: c6x-elf-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=c6x 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/staging/wilc1000/wilc_spi.c: In function 'wilc_bus_probe':
>> drivers/staging/wilc1000/wilc_spi.c:136:6: error: 'struct wilc' has no member named 'rtc_clk'
     wilc->rtc_clk = devm_clk_get(&spi->dev, "rtc_clk");
         ^~
   drivers/staging/wilc1000/wilc_spi.c:137:26: error: 'struct wilc' has no member named 'rtc_clk'
     if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER)
                             ^~
   drivers/staging/wilc1000/wilc_spi.c:139:23: error: 'struct wilc' has no member named 'rtc_clk'
     else if (!IS_ERR(wilc->rtc_clk))
                          ^~
   drivers/staging/wilc1000/wilc_spi.c:140:26: error: 'struct wilc' has no member named 'rtc_clk'
      clk_prepare_enable(wilc->rtc_clk);
                             ^~
   drivers/staging/wilc1000/wilc_spi.c: In function 'wilc_bus_remove':
   drivers/staging/wilc1000/wilc_spi.c:153:18: error: 'struct wilc' has no member named 'rtc_clk'
     if (!IS_ERR(wilc->rtc_clk))
                     ^~
   drivers/staging/wilc1000/wilc_spi.c:154:29: error: 'struct wilc' has no member named 'rtc_clk'
      clk_disable_unprepare(wilc->rtc_clk);
                                ^~

vim +136 drivers/staging/wilc1000/wilc_spi.c

   105	
   106	static int wilc_bus_probe(struct spi_device *spi)
   107	{
   108		int ret;
   109		struct wilc *wilc;
   110		struct gpio_desc *gpio;
   111		struct wilc_spi *spi_priv;
   112	
   113		spi_priv = kzalloc(sizeof(*spi_priv), GFP_KERNEL);
   114		if (!spi_priv)
   115			return -ENOMEM;
   116	
   117		gpio = gpiod_get(&spi->dev, "irq", GPIOD_IN);
   118		if (IS_ERR(gpio)) {
   119			/* get the GPIO descriptor from hardcode GPIO number */
   120			gpio = gpio_to_desc(GPIO_NUM);
   121			if (!gpio)
   122				dev_err(&spi->dev, "failed to get the irq gpio\n");
   123		}
   124	
   125		ret = wilc_cfg80211_init(&wilc, &spi->dev, WILC_HIF_SPI, &wilc_hif_spi);
   126		if (ret) {
   127			kfree(spi_priv);
   128			return ret;
   129		}
   130	
   131		spi_set_drvdata(spi, wilc);
   132		wilc->dev = &spi->dev;
   133		wilc->bus_data = spi_priv;
   134		wilc->gpio_irq = gpio;
   135	
 > 136		wilc->rtc_clk = devm_clk_get(&spi->dev, "rtc_clk");
   137		if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER)
   138			return -EPROBE_DEFER;
   139		else if (!IS_ERR(wilc->rtc_clk))
   140			clk_prepare_enable(wilc->rtc_clk);
   141	
   142		return 0;
   143	}
   144	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 49705 bytes --]

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

* Re: [PATCH] staging: wilc1000: look for rtc_clk clock in spi mode
  2019-09-17  0:49 ` kbuild test robot
@ 2019-09-17  1:03   ` Adham.Abozaeid
  2019-09-18  1:41     ` [kbuild-all] " Rong Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Adham.Abozaeid @ 2019-09-17  1:03 UTC (permalink / raw)
  To: lkp
  Cc: kbuild-all, linux-wireless, devel, gregkh, johannes, Ajay.Kathat,
	Eugen.Hristev



On 9/16/19 5:49 PM, kbuild test robot wrote:
>
> [auto build test ERROR on linus/master]
> [cannot apply to v5.3 next-20190916]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
This patch applies for staging-testing, not linus/master.

Thanks,
Adham

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

* Re: [PATCH] staging: wilc1000: look for rtc_clk clock in spi mode
  2019-09-16 19:37 [PATCH] staging: wilc1000: look for rtc_clk clock in spi mode Adham.Abozaeid
  2019-09-17  0:49 ` kbuild test robot
@ 2019-09-17  7:11 ` Claudiu.Beznea
  2019-09-17  7:20   ` Claudiu.Beznea
  1 sibling, 1 reply; 6+ messages in thread
From: Claudiu.Beznea @ 2019-09-17  7:11 UTC (permalink / raw)
  To: Adham.Abozaeid, linux-wireless
  Cc: devel, Ajay.Kathat, gregkh, Eugen.Hristev, johannes

This is already present in staging-next (see [1] and [2])

[1] https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/wilc1000?h=staging-next&id=8692b047e86cff448af1564a8bdda770d2deb567
[2] https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/wilc1000?h=staging-next&id=ae8779e1983d6361620f1f6d3f76064edee733c0

On 16.09.2019 22:37, Adham.Abozaeid@microchip.com wrote:
> External E-Mail
> 
> 
> From: Adham Abozaeid <adham.abozaeid@microchip.com>
> 
> If rtc_clk is provided from DT, use it and enable it.
> This is optional.
> The signal may be hardcoded and no need to be requested,
> but if DT provides it, use it.
> 
> Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
> ---
>  drivers/staging/wilc1000/wilc_spi.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
> index 3c1ae9e9f9aa..166455a969bf 100644
> --- a/drivers/staging/wilc1000/wilc_spi.c
> +++ b/drivers/staging/wilc1000/wilc_spi.c
> @@ -4,6 +4,7 @@
>   * All rights reserved.
>   */
>  
> +#include <linux/clk.h>
>  #include <linux/spi/spi.h>
>  
>  #include "wilc_wfi_netdevice.h"
> @@ -132,6 +133,12 @@ static int wilc_bus_probe(struct spi_device *spi)
>  	wilc->bus_data = spi_priv;
>  	wilc->gpio_irq = gpio;
>  
> +	wilc->rtc_clk = devm_clk_get(&spi->dev, "rtc_clk");
> +	if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER)
> +		return -EPROBE_DEFER;
> +	else if (!IS_ERR(wilc->rtc_clk))
> +		clk_prepare_enable(wilc->rtc_clk);
> +
>  	return 0;
>  }
>  
> @@ -142,6 +149,10 @@ static int wilc_bus_remove(struct spi_device *spi)
>  	/* free the GPIO in module remove */
>  	if (wilc->gpio_irq)
>  		gpiod_put(wilc->gpio_irq);
> +
> +	if (!IS_ERR(wilc->rtc_clk))
> +		clk_disable_unprepare(wilc->rtc_clk);
> +
>  	wilc_netdev_cleanup(wilc);
>  	return 0;
>  }
> 

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

* Re: [PATCH] staging: wilc1000: look for rtc_clk clock in spi mode
  2019-09-17  7:11 ` Claudiu.Beznea
@ 2019-09-17  7:20   ` Claudiu.Beznea
  0 siblings, 0 replies; 6+ messages in thread
From: Claudiu.Beznea @ 2019-09-17  7:20 UTC (permalink / raw)
  To: Adham.Abozaeid, linux-wireless
  Cc: devel, Ajay.Kathat, gregkh, Eugen.Hristev, johannes

Now I see that your patch is for SPI interface, so, it may be necessary.

Sorry for the noise.

On 17.09.2019 10:11, Claudiu.Beznea@microchip.com wrote:
> This is already present in staging-next (see [1] and [2])
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/wilc1000?h=staging-next&id=8692b047e86cff448af1564a8bdda770d2deb567
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/wilc1000?h=staging-next&id=ae8779e1983d6361620f1f6d3f76064edee733c0
> 
> On 16.09.2019 22:37, Adham.Abozaeid@microchip.com wrote:
>> External E-Mail
>>
>>
>> From: Adham Abozaeid <adham.abozaeid@microchip.com>
>>
>> If rtc_clk is provided from DT, use it and enable it.
>> This is optional.
>> The signal may be hardcoded and no need to be requested,
>> but if DT provides it, use it.
>>
>> Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
>> ---
>>  drivers/staging/wilc1000/wilc_spi.c | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
>> index 3c1ae9e9f9aa..166455a969bf 100644
>> --- a/drivers/staging/wilc1000/wilc_spi.c
>> +++ b/drivers/staging/wilc1000/wilc_spi.c
>> @@ -4,6 +4,7 @@
>>   * All rights reserved.
>>   */
>>  
>> +#include <linux/clk.h>
>>  #include <linux/spi/spi.h>
>>  
>>  #include "wilc_wfi_netdevice.h"
>> @@ -132,6 +133,12 @@ static int wilc_bus_probe(struct spi_device *spi)
>>  	wilc->bus_data = spi_priv;
>>  	wilc->gpio_irq = gpio;
>>  
>> +	wilc->rtc_clk = devm_clk_get(&spi->dev, "rtc_clk");
>> +	if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER)
>> +		return -EPROBE_DEFER;
>> +	else if (!IS_ERR(wilc->rtc_clk))
>> +		clk_prepare_enable(wilc->rtc_clk);
>> +
>>  	return 0;
>>  }
>>  
>> @@ -142,6 +149,10 @@ static int wilc_bus_remove(struct spi_device *spi)
>>  	/* free the GPIO in module remove */
>>  	if (wilc->gpio_irq)
>>  		gpiod_put(wilc->gpio_irq);
>> +
>> +	if (!IS_ERR(wilc->rtc_clk))
>> +		clk_disable_unprepare(wilc->rtc_clk);
>> +
>>  	wilc_netdev_cleanup(wilc);
>>  	return 0;
>>  }
>>

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

* Re: [kbuild-all] [PATCH] staging: wilc1000: look for rtc_clk clock in spi mode
  2019-09-17  1:03   ` Adham.Abozaeid
@ 2019-09-18  1:41     ` Rong Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Rong Chen @ 2019-09-18  1:41 UTC (permalink / raw)
  To: Adham.Abozaeid, lkp
  Cc: devel, Ajay.Kathat, gregkh, linux-wireless, kbuild-all,
	Eugen.Hristev, johannes

Hi Adham,

On 9/17/19 9:03 AM, Adham.Abozaeid@microchip.com wrote:
>
> On 9/16/19 5:49 PM, kbuild test robot wrote:
>> [auto build test ERROR on linus/master]
>> [cannot apply to v5.3 next-20190916]
>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> This patch applies for staging-testing, not linus/master.
>
>

Thanks for clarification, we'll take a look. BTW 0day-CI introduced 
'--base' option to record base tree info in format-patch.
could you kindly add it to help robot to base on the right tree? please 
see https://stackoverflow.com/a/37406982

Best Regards,
Rong Chen

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

end of thread, other threads:[~2019-09-18  1:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-16 19:37 [PATCH] staging: wilc1000: look for rtc_clk clock in spi mode Adham.Abozaeid
2019-09-17  0:49 ` kbuild test robot
2019-09-17  1:03   ` Adham.Abozaeid
2019-09-18  1:41     ` [kbuild-all] " Rong Chen
2019-09-17  7:11 ` Claudiu.Beznea
2019-09-17  7:20   ` Claudiu.Beznea

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