All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] [net-next] Let spi drivers return 0 in .remove()
@ 2021-10-14 14:13 Uwe Kleine-König
  2021-10-14 14:13 ` [PATCH 1/2] net: ks8851: Make ks8851_remove_common() return void Uwe Kleine-König
  2021-10-14 14:13 ` [PATCH 2/2] net: w5100: Make w5100_remove() " Uwe Kleine-König
  0 siblings, 2 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2021-10-14 14:13 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: kernel, Andrew Lunn, Arnd Bergmann, Marek Vasut, Mark Brown,
	Michael Walle, Nathan Chancellor, Tom Rix, Yang Yingliang,
	Zheng Yongjun, linux-spi, netdev

Hello,

this series is part of my quest to change the return type of the spi
driver .remove() callback to void. In this first stage I fix all drivers
to return 0 to be able to mechanically change all drivers in the final
step. Here the two spi drivers in net are fixed to obviously return 0.

Returning an error code (which actually very few drivers do) doesn't
make much sense, because the only effect is that the spi core emits an
error message.

The same holds try for platform drivers, one of them is fixed en passant.

There is no need to coordinate application of this series. There is
still much to do until struct spi_driver can be changed.

Best regards
Uwe

Uwe Kleine-König (2):
  net: ks8851: Make ks8851_remove_common() return void
  net: w5100: Make w5100_remove() return void

 drivers/net/ethernet/micrel/ks8851.h        | 2 +-
 drivers/net/ethernet/micrel/ks8851_common.c | 4 +---
 drivers/net/ethernet/micrel/ks8851_par.c    | 4 +++-
 drivers/net/ethernet/micrel/ks8851_spi.c    | 4 +++-
 drivers/net/ethernet/wiznet/w5100-spi.c     | 4 +++-
 drivers/net/ethernet/wiznet/w5100.c         | 7 ++++---
 drivers/net/ethernet/wiznet/w5100.h         | 2 +-
 7 files changed, 16 insertions(+), 11 deletions(-)


base-commit: 9e1ff307c779ce1f0f810c7ecce3d95bbae40896
-- 
2.30.2


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

* [PATCH 1/2] net: ks8851: Make ks8851_remove_common() return void
  2021-10-14 14:13 [PATCH 0/2] [net-next] Let spi drivers return 0 in .remove() Uwe Kleine-König
@ 2021-10-14 14:13 ` Uwe Kleine-König
  2021-10-14 14:13 ` [PATCH 2/2] net: w5100: Make w5100_remove() " Uwe Kleine-König
  1 sibling, 0 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2021-10-14 14:13 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: kernel, Andrew Lunn, Arnd Bergmann, Marek Vasut, Mark Brown,
	Michael Walle, Nathan Chancellor, Tom Rix, Zheng Yongjun,
	linux-spi, netdev

Up to now ks8851_remove_common() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.

Also the return value of platform and spi remove callbacks is ignored
anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/ethernet/micrel/ks8851.h        | 2 +-
 drivers/net/ethernet/micrel/ks8851_common.c | 4 +---
 drivers/net/ethernet/micrel/ks8851_par.c    | 4 +++-
 drivers/net/ethernet/micrel/ks8851_spi.c    | 4 +++-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/micrel/ks8851.h b/drivers/net/ethernet/micrel/ks8851.h
index e2eb0caeac82..6f34a61739b6 100644
--- a/drivers/net/ethernet/micrel/ks8851.h
+++ b/drivers/net/ethernet/micrel/ks8851.h
@@ -427,7 +427,7 @@ struct ks8851_net {
 
 int ks8851_probe_common(struct net_device *netdev, struct device *dev,
 			int msg_en);
-int ks8851_remove_common(struct device *dev);
+void ks8851_remove_common(struct device *dev);
 int ks8851_suspend(struct device *dev);
 int ks8851_resume(struct device *dev);
 
diff --git a/drivers/net/ethernet/micrel/ks8851_common.c b/drivers/net/ethernet/micrel/ks8851_common.c
index a6db1a8156e1..77f3d2f820fb 100644
--- a/drivers/net/ethernet/micrel/ks8851_common.c
+++ b/drivers/net/ethernet/micrel/ks8851_common.c
@@ -1247,7 +1247,7 @@ int ks8851_probe_common(struct net_device *netdev, struct device *dev,
 }
 EXPORT_SYMBOL_GPL(ks8851_probe_common);
 
-int ks8851_remove_common(struct device *dev)
+void ks8851_remove_common(struct device *dev)
 {
 	struct ks8851_net *priv = dev_get_drvdata(dev);
 
@@ -1261,8 +1261,6 @@ int ks8851_remove_common(struct device *dev)
 		gpio_set_value(priv->gpio, 0);
 	regulator_disable(priv->vdd_reg);
 	regulator_disable(priv->vdd_io);
-
-	return 0;
 }
 EXPORT_SYMBOL_GPL(ks8851_remove_common);
 
diff --git a/drivers/net/ethernet/micrel/ks8851_par.c b/drivers/net/ethernet/micrel/ks8851_par.c
index 2e8fcce50f9d..2e25798c610e 100644
--- a/drivers/net/ethernet/micrel/ks8851_par.c
+++ b/drivers/net/ethernet/micrel/ks8851_par.c
@@ -327,7 +327,9 @@ static int ks8851_probe_par(struct platform_device *pdev)
 
 static int ks8851_remove_par(struct platform_device *pdev)
 {
-	return ks8851_remove_common(&pdev->dev);
+	ks8851_remove_common(&pdev->dev);
+
+	return 0;
 }
 
 static const struct of_device_id ks8851_match_table[] = {
diff --git a/drivers/net/ethernet/micrel/ks8851_spi.c b/drivers/net/ethernet/micrel/ks8851_spi.c
index 479406ecbaa3..0303e727e99f 100644
--- a/drivers/net/ethernet/micrel/ks8851_spi.c
+++ b/drivers/net/ethernet/micrel/ks8851_spi.c
@@ -454,7 +454,9 @@ static int ks8851_probe_spi(struct spi_device *spi)
 
 static int ks8851_remove_spi(struct spi_device *spi)
 {
-	return ks8851_remove_common(&spi->dev);
+	ks8851_remove_common(&spi->dev);
+
+	return 0;
 }
 
 static const struct of_device_id ks8851_match_table[] = {
-- 
2.30.2


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

* [PATCH 2/2] net: w5100: Make w5100_remove() return void
  2021-10-14 14:13 [PATCH 0/2] [net-next] Let spi drivers return 0 in .remove() Uwe Kleine-König
  2021-10-14 14:13 ` [PATCH 1/2] net: ks8851: Make ks8851_remove_common() return void Uwe Kleine-König
@ 2021-10-14 14:13 ` Uwe Kleine-König
  2021-10-14 20:35     ` kernel test robot
  2021-10-15  7:06     ` kernel test robot
  1 sibling, 2 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2021-10-14 14:13 UTC (permalink / raw)
  To: David S. Miller
  Cc: kernel, Andrew Lunn, Michael Walle, Yang Yingliang, Mark Brown,
	linux-spi, netdev

Up to now w5100_remove() returns zero unconditionally. Make it return
void instead which makes it easier to see in the callers that there is
no error to handle.

Also the return value of platform and spi remove callbacks is ignored
anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/ethernet/wiznet/w5100-spi.c | 4 +++-
 drivers/net/ethernet/wiznet/w5100.c     | 7 ++++---
 drivers/net/ethernet/wiznet/w5100.h     | 2 +-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/wiznet/w5100-spi.c b/drivers/net/ethernet/wiznet/w5100-spi.c
index 2b84848dc26a..7779a36da3c8 100644
--- a/drivers/net/ethernet/wiznet/w5100-spi.c
+++ b/drivers/net/ethernet/wiznet/w5100-spi.c
@@ -463,7 +463,9 @@ static int w5100_spi_probe(struct spi_device *spi)
 
 static int w5100_spi_remove(struct spi_device *spi)
 {
-	return w5100_remove(&spi->dev);
+	w5100_remove(&spi->dev);
+
+	return 0;
 }
 
 static const struct spi_device_id w5100_spi_ids[] = {
diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c
index f974e70a82e8..2e8a5ba6b908 100644
--- a/drivers/net/ethernet/wiznet/w5100.c
+++ b/drivers/net/ethernet/wiznet/w5100.c
@@ -1064,7 +1064,9 @@ static int w5100_mmio_probe(struct platform_device *pdev)
 
 static int w5100_mmio_remove(struct platform_device *pdev)
 {
-	return w5100_remove(&pdev->dev);
+	w5100_remove(&pdev->dev);
+
+	return 0
 }
 
 void *w5100_ops_priv(const struct net_device *ndev)
@@ -1210,7 +1212,7 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,
 }
 EXPORT_SYMBOL_GPL(w5100_probe);
 
-int w5100_remove(struct device *dev)
+void w5100_remove(struct device *dev)
 {
 	struct net_device *ndev = dev_get_drvdata(dev);
 	struct w5100_priv *priv = netdev_priv(ndev);
@@ -1226,7 +1228,6 @@ int w5100_remove(struct device *dev)
 
 	unregister_netdev(ndev);
 	free_netdev(ndev);
-	return 0;
 }
 EXPORT_SYMBOL_GPL(w5100_remove);
 
diff --git a/drivers/net/ethernet/wiznet/w5100.h b/drivers/net/ethernet/wiznet/w5100.h
index 5d3d4b541fec..481af3b6d9e8 100644
--- a/drivers/net/ethernet/wiznet/w5100.h
+++ b/drivers/net/ethernet/wiznet/w5100.h
@@ -31,6 +31,6 @@ void *w5100_ops_priv(const struct net_device *ndev);
 int w5100_probe(struct device *dev, const struct w5100_ops *ops,
 		int sizeof_ops_priv, const void *mac_addr, int irq,
 		int link_gpio);
-int w5100_remove(struct device *dev);
+void w5100_remove(struct device *dev);
 
 extern const struct dev_pm_ops w5100_pm_ops;
-- 
2.30.2


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

* Re: [PATCH 2/2] net: w5100: Make w5100_remove() return void
  2021-10-14 14:13 ` [PATCH 2/2] net: w5100: Make w5100_remove() " Uwe Kleine-König
@ 2021-10-14 20:35     ` kernel test robot
  2021-10-15  7:06     ` kernel test robot
  1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-10-14 20:35 UTC (permalink / raw)
  To: Uwe Kleine-König, David S. Miller
  Cc: llvm, kbuild-all, netdev, kernel, Andrew Lunn, Michael Walle,
	Yang Yingliang, Mark Brown, linux-spi

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

Hi "Uwe,

I love your patch! Yet something to improve:

[auto build test ERROR on 9e1ff307c779ce1f0f810c7ecce3d95bbae40896]

url:    https://github.com/0day-ci/linux/commits/Uwe-Kleine-K-nig/Let-spi-drivers-return-0-in-remove/20211014-221546
base:   9e1ff307c779ce1f0f810c7ecce3d95bbae40896
config: hexagon-randconfig-r041-20211014 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6c76d0101193aa4eb891a6954ff047eda2f9cf71)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8f3e2ba8c698fe9dc9df832c5f16e6d871ab85a4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Uwe-Kleine-K-nig/Let-spi-drivers-return-0-in-remove/20211014-221546
        git checkout 8f3e2ba8c698fe9dc9df832c5f16e6d871ab85a4
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/net/ethernet/wiznet/

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

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/wiznet/w5100.c:1069:10: error: expected ';' after return statement
           return 0
                   ^
                   ;
   1 error generated.


vim +1069 drivers/net/ethernet/wiznet/w5100.c

  1064	
  1065	static int w5100_mmio_remove(struct platform_device *pdev)
  1066	{
  1067		w5100_remove(&pdev->dev);
  1068	
> 1069		return 0
  1070	}
  1071	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

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

* Re: [PATCH 2/2] net: w5100: Make w5100_remove() return void
@ 2021-10-14 20:35     ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-10-14 20:35 UTC (permalink / raw)
  To: kbuild-all

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

Hi "Uwe,

I love your patch! Yet something to improve:

[auto build test ERROR on 9e1ff307c779ce1f0f810c7ecce3d95bbae40896]

url:    https://github.com/0day-ci/linux/commits/Uwe-Kleine-K-nig/Let-spi-drivers-return-0-in-remove/20211014-221546
base:   9e1ff307c779ce1f0f810c7ecce3d95bbae40896
config: hexagon-randconfig-r041-20211014 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6c76d0101193aa4eb891a6954ff047eda2f9cf71)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8f3e2ba8c698fe9dc9df832c5f16e6d871ab85a4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Uwe-Kleine-K-nig/Let-spi-drivers-return-0-in-remove/20211014-221546
        git checkout 8f3e2ba8c698fe9dc9df832c5f16e6d871ab85a4
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/net/ethernet/wiznet/

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

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/wiznet/w5100.c:1069:10: error: expected ';' after return statement
           return 0
                   ^
                   ;
   1 error generated.


vim +1069 drivers/net/ethernet/wiznet/w5100.c

  1064	
  1065	static int w5100_mmio_remove(struct platform_device *pdev)
  1066	{
  1067		w5100_remove(&pdev->dev);
  1068	
> 1069		return 0
  1070	}
  1071	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

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

* Re: [PATCH 2/2] net: w5100: Make w5100_remove() return void
  2021-10-14 14:13 ` [PATCH 2/2] net: w5100: Make w5100_remove() " Uwe Kleine-König
@ 2021-10-15  7:06     ` kernel test robot
  2021-10-15  7:06     ` kernel test robot
  1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-10-15  7:06 UTC (permalink / raw)
  To: Uwe Kleine-König, David S. Miller
  Cc: kbuild-all, netdev, kernel, Andrew Lunn, Michael Walle,
	Yang Yingliang, Mark Brown, linux-spi

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

Hi "Uwe,

I love your patch! Yet something to improve:

[auto build test ERROR on 9e1ff307c779ce1f0f810c7ecce3d95bbae40896]

url:    https://github.com/0day-ci/linux/commits/Uwe-Kleine-K-nig/Let-spi-drivers-return-0-in-remove/20211014-221546
base:   9e1ff307c779ce1f0f810c7ecce3d95bbae40896
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8f3e2ba8c698fe9dc9df832c5f16e6d871ab85a4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Uwe-Kleine-K-nig/Let-spi-drivers-return-0-in-remove/20211014-221546
        git checkout 8f3e2ba8c698fe9dc9df832c5f16e6d871ab85a4
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

   drivers/net/ethernet/wiznet/w5100.c: In function 'w5100_mmio_remove':
>> drivers/net/ethernet/wiznet/w5100.c:1069:17: error: expected ';' before '}' token
    1069 |         return 0
         |                 ^
         |                 ;
    1070 | }
         | ~                


vim +1069 drivers/net/ethernet/wiznet/w5100.c

  1064	
  1065	static int w5100_mmio_remove(struct platform_device *pdev)
  1066	{
  1067		w5100_remove(&pdev->dev);
  1068	
> 1069		return 0
  1070	}
  1071	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

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

* Re: [PATCH 2/2] net: w5100: Make w5100_remove() return void
@ 2021-10-15  7:06     ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-10-15  7:06 UTC (permalink / raw)
  To: kbuild-all

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

Hi "Uwe,

I love your patch! Yet something to improve:

[auto build test ERROR on 9e1ff307c779ce1f0f810c7ecce3d95bbae40896]

url:    https://github.com/0day-ci/linux/commits/Uwe-Kleine-K-nig/Let-spi-drivers-return-0-in-remove/20211014-221546
base:   9e1ff307c779ce1f0f810c7ecce3d95bbae40896
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8f3e2ba8c698fe9dc9df832c5f16e6d871ab85a4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Uwe-Kleine-K-nig/Let-spi-drivers-return-0-in-remove/20211014-221546
        git checkout 8f3e2ba8c698fe9dc9df832c5f16e6d871ab85a4
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

   drivers/net/ethernet/wiznet/w5100.c: In function 'w5100_mmio_remove':
>> drivers/net/ethernet/wiznet/w5100.c:1069:17: error: expected ';' before '}' token
    1069 |         return 0
         |                 ^
         |                 ;
    1070 | }
         | ~                


vim +1069 drivers/net/ethernet/wiznet/w5100.c

  1064	
  1065	static int w5100_mmio_remove(struct platform_device *pdev)
  1066	{
  1067		w5100_remove(&pdev->dev);
  1068	
> 1069		return 0
  1070	}
  1071	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

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

end of thread, other threads:[~2021-10-15  7:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 14:13 [PATCH 0/2] [net-next] Let spi drivers return 0 in .remove() Uwe Kleine-König
2021-10-14 14:13 ` [PATCH 1/2] net: ks8851: Make ks8851_remove_common() return void Uwe Kleine-König
2021-10-14 14:13 ` [PATCH 2/2] net: w5100: Make w5100_remove() " Uwe Kleine-König
2021-10-14 20:35   ` kernel test robot
2021-10-14 20:35     ` kernel test robot
2021-10-15  7:06   ` kernel test robot
2021-10-15  7:06     ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.