Re: [PATCH 6/6] i2c: Make remove callback return void

2022-06-29 Thread Maximilian Luz

_Roh=c3=a1r?= , "David S. Miller" 
Errors-To: linuxppc-dev-bounces+archive=mail-archive@lists.ozlabs.org
Sender: "Linuxppc-dev" 


On 6/28/22 16:03, Uwe Kleine-König wrote:

From: Uwe Kleine-König 

The value returned by an i2c driver's remove function is mostly ignored.
(Only an error message is printed if the value is non-zero that the
error is ignored.)

So change the prototype of the remove function to return no value. This
way driver authors are not tempted to assume that passing an error to
the upper layer is a good idea. All drivers are adapted accordingly.
There is no intended change of behaviour, all callbacks were prepared to
return 0 before.

Signed-off-by: Uwe Kleine-König 


[...]

  drivers/platform/surface/surface3_power.c | 4 +---


[...]


diff --git a/drivers/platform/surface/surface3_power.c 
b/drivers/platform/surface/surface3_power.c
index 444ec81ba02d..3b20dddeb815 100644
--- a/drivers/platform/surface/surface3_power.c
+++ b/drivers/platform/surface/surface3_power.c
@@ -554,7 +554,7 @@ static int mshw0011_probe(struct i2c_client *client)
return error;
  }
  
-static int mshw0011_remove(struct i2c_client *client)

+static void mshw0011_remove(struct i2c_client *client)
  {
struct mshw0011_data *cdata = i2c_get_clientdata(client);
  
@@ -564,8 +564,6 @@ static int mshw0011_remove(struct i2c_client *client)

kthread_stop(cdata->poll_task);
  
  	i2c_unregister_device(cdata->bat0);

-
-   return 0;
  }
  
  static const struct acpi_device_id mshw0011_acpi_match[] = {


For the quoted above:

Reviewed-by: Maximilian Luz 


Re: [PATCH] bus: Make remove callback return void

2021-07-06 Thread Maximilian Luz

On 7/6/21 11:50 AM, Uwe Kleine-König wrote:

The driver core ignores the return value of this callback because there
is only little it can do when a device disappears.

This is the final bit of a long lasting cleanup quest where several
buses were converted to also return void from their remove callback.
Additionally some resource leaks were fixed that were caused by drivers
returning an error code in the expectation that the driver won't go
away.

With struct bus_type::remove returning void it's prevented that newly
implemented buses return an ignored error code and so don't anticipate
wrong expectations for driver authors.

Signed-off-by: Uwe Kleine-König 



  drivers/platform/surface/aggregator/bus.c | 4 +---


Acked-by: Maximilian Luz