linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i3c: Remove unused i3c_device_do_setdasa
@ 2024-12-21 14:34 linux
  2025-01-12 22:54 ` Alexandre Belloni
  0 siblings, 1 reply; 4+ messages in thread
From: linux @ 2024-12-21 14:34 UTC (permalink / raw)
  To: alexandre.belloni, linux-i3c; +Cc: linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

i3c_device_do_setdasa() was added in 2022 as part of
commit 672825cd2823 ("i3c: export SETDASA method")

but has been unused.

It calls i3c_dev_setdasa_locked() which is now also unused.

Remove them both.
(This is effectively a revert of 672825cd2823).

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/i3c/device.c       | 20 --------------------
 drivers/i3c/internals.h    |  1 -
 drivers/i3c/master.c       | 19 -------------------
 include/linux/i3c/device.h |  2 --
 4 files changed, 42 deletions(-)

diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c
index e80e48756914..984976f28314 100644
--- a/drivers/i3c/device.c
+++ b/drivers/i3c/device.c
@@ -54,26 +54,6 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
 }
 EXPORT_SYMBOL_GPL(i3c_device_do_priv_xfers);
 
-/**
- * i3c_device_do_setdasa() - do I3C dynamic address assignement with
- *                           static address
- *
- * @dev: device with which the DAA should be done
- *
- * Return: 0 in case of success, a negative error core otherwise.
- */
-int i3c_device_do_setdasa(struct i3c_device *dev)
-{
-	int ret;
-
-	i3c_bus_normaluse_lock(dev->bus);
-	ret = i3c_dev_setdasa_locked(dev->desc);
-	i3c_bus_normaluse_unlock(dev->bus);
-
-	return ret;
-}
-EXPORT_SYMBOL_GPL(i3c_device_do_setdasa);
-
 /**
  * i3c_device_get_info() - get I3C device information
  *
diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h
index 433f6088b7ce..842e1a865877 100644
--- a/drivers/i3c/internals.h
+++ b/drivers/i3c/internals.h
@@ -13,7 +13,6 @@
 void i3c_bus_normaluse_lock(struct i3c_bus *bus);
 void i3c_bus_normaluse_unlock(struct i3c_bus *bus);
 
-int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev);
 int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
 				 struct i3c_priv_xfer *xfers,
 				 int nxfers);
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 42310c9a00c2..000187339400 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -2916,25 +2916,6 @@ void i3c_master_unregister(struct i3c_master_controller *master)
 }
 EXPORT_SYMBOL_GPL(i3c_master_unregister);
 
-int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev)
-{
-	struct i3c_master_controller *master;
-
-	if (!dev)
-		return -ENOENT;
-
-	master = i3c_dev_get_master(dev);
-	if (!master)
-		return -EINVAL;
-
-	if (!dev->boardinfo || !dev->boardinfo->init_dyn_addr ||
-		!dev->boardinfo->static_addr)
-		return -EINVAL;
-
-	return i3c_master_setdasa_locked(master, dev->info.static_addr,
-						dev->boardinfo->init_dyn_addr);
-}
-
 int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
 				 struct i3c_priv_xfer *xfers,
 				 int nxfers)
diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h
index 0a8a44ac2f02..f4e924c179d7 100644
--- a/include/linux/i3c/device.h
+++ b/include/linux/i3c/device.h
@@ -301,8 +301,6 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
 			     struct i3c_priv_xfer *xfers,
 			     int nxfers);
 
-int i3c_device_do_setdasa(struct i3c_device *dev);
-
 void i3c_device_get_info(const struct i3c_device *dev, struct i3c_device_info *info);
 
 struct i3c_ibi_payload {
-- 
2.47.1


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

* Re: [PATCH] i3c: Remove unused i3c_device_do_setdasa
  2024-12-21 14:34 [PATCH] i3c: Remove unused i3c_device_do_setdasa linux
@ 2025-01-12 22:54 ` Alexandre Belloni
  2025-01-12 22:57   ` Dr. David Alan Gilbert
  2025-01-13 10:00   ` Mukesh Kumar Savaliya
  0 siblings, 2 replies; 4+ messages in thread
From: Alexandre Belloni @ 2025-01-12 22:54 UTC (permalink / raw)
  To: linux; +Cc: linux-i3c, linux-kernel

Hello,

On 21/12/2024 14:34:18+0000, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> i3c_device_do_setdasa() was added in 2022 as part of
> commit 672825cd2823 ("i3c: export SETDASA method")
> 
> but has been unused.
> 
> It calls i3c_dev_setdasa_locked() which is now also unused.
> 
> Remove them both.
> (This is effectively a revert of 672825cd2823).
> 


Yeah, i guess this just means that we didn't see the device driver yet.
I'm going to keep those function around for now.

> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
>  drivers/i3c/device.c       | 20 --------------------
>  drivers/i3c/internals.h    |  1 -
>  drivers/i3c/master.c       | 19 -------------------
>  include/linux/i3c/device.h |  2 --
>  4 files changed, 42 deletions(-)
> 
> diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c
> index e80e48756914..984976f28314 100644
> --- a/drivers/i3c/device.c
> +++ b/drivers/i3c/device.c
> @@ -54,26 +54,6 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
>  }
>  EXPORT_SYMBOL_GPL(i3c_device_do_priv_xfers);
>  
> -/**
> - * i3c_device_do_setdasa() - do I3C dynamic address assignement with
> - *                           static address
> - *
> - * @dev: device with which the DAA should be done
> - *
> - * Return: 0 in case of success, a negative error core otherwise.
> - */
> -int i3c_device_do_setdasa(struct i3c_device *dev)
> -{
> -	int ret;
> -
> -	i3c_bus_normaluse_lock(dev->bus);
> -	ret = i3c_dev_setdasa_locked(dev->desc);
> -	i3c_bus_normaluse_unlock(dev->bus);
> -
> -	return ret;
> -}
> -EXPORT_SYMBOL_GPL(i3c_device_do_setdasa);
> -
>  /**
>   * i3c_device_get_info() - get I3C device information
>   *
> diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h
> index 433f6088b7ce..842e1a865877 100644
> --- a/drivers/i3c/internals.h
> +++ b/drivers/i3c/internals.h
> @@ -13,7 +13,6 @@
>  void i3c_bus_normaluse_lock(struct i3c_bus *bus);
>  void i3c_bus_normaluse_unlock(struct i3c_bus *bus);
>  
> -int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev);
>  int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
>  				 struct i3c_priv_xfer *xfers,
>  				 int nxfers);
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 42310c9a00c2..000187339400 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -2916,25 +2916,6 @@ void i3c_master_unregister(struct i3c_master_controller *master)
>  }
>  EXPORT_SYMBOL_GPL(i3c_master_unregister);
>  
> -int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev)
> -{
> -	struct i3c_master_controller *master;
> -
> -	if (!dev)
> -		return -ENOENT;
> -
> -	master = i3c_dev_get_master(dev);
> -	if (!master)
> -		return -EINVAL;
> -
> -	if (!dev->boardinfo || !dev->boardinfo->init_dyn_addr ||
> -		!dev->boardinfo->static_addr)
> -		return -EINVAL;
> -
> -	return i3c_master_setdasa_locked(master, dev->info.static_addr,
> -						dev->boardinfo->init_dyn_addr);
> -}
> -
>  int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
>  				 struct i3c_priv_xfer *xfers,
>  				 int nxfers)
> diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h
> index 0a8a44ac2f02..f4e924c179d7 100644
> --- a/include/linux/i3c/device.h
> +++ b/include/linux/i3c/device.h
> @@ -301,8 +301,6 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
>  			     struct i3c_priv_xfer *xfers,
>  			     int nxfers);
>  
> -int i3c_device_do_setdasa(struct i3c_device *dev);
> -
>  void i3c_device_get_info(const struct i3c_device *dev, struct i3c_device_info *info);
>  
>  struct i3c_ibi_payload {
> -- 
> 2.47.1
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] i3c: Remove unused i3c_device_do_setdasa
  2025-01-12 22:54 ` Alexandre Belloni
@ 2025-01-12 22:57   ` Dr. David Alan Gilbert
  2025-01-13 10:00   ` Mukesh Kumar Savaliya
  1 sibling, 0 replies; 4+ messages in thread
From: Dr. David Alan Gilbert @ 2025-01-12 22:57 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: linux-i3c, linux-kernel

* Alexandre Belloni (alexandre.belloni@bootlin.com) wrote:
> Hello,
> 
> On 21/12/2024 14:34:18+0000, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > 
> > i3c_device_do_setdasa() was added in 2022 as part of
> > commit 672825cd2823 ("i3c: export SETDASA method")
> > 
> > but has been unused.
> > 
> > It calls i3c_dev_setdasa_locked() which is now also unused.
> > 
> > Remove them both.
> > (This is effectively a revert of 672825cd2823).
> > 
> 
> 
> Yeah, i guess this just means that we didn't see the device driver yet.
> I'm going to keep those function around for now.

OK, thanks for the review.

Dave

> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> > ---
> >  drivers/i3c/device.c       | 20 --------------------
> >  drivers/i3c/internals.h    |  1 -
> >  drivers/i3c/master.c       | 19 -------------------
> >  include/linux/i3c/device.h |  2 --
> >  4 files changed, 42 deletions(-)
> > 
> > diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c
> > index e80e48756914..984976f28314 100644
> > --- a/drivers/i3c/device.c
> > +++ b/drivers/i3c/device.c
> > @@ -54,26 +54,6 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
> >  }
> >  EXPORT_SYMBOL_GPL(i3c_device_do_priv_xfers);
> >  
> > -/**
> > - * i3c_device_do_setdasa() - do I3C dynamic address assignement with
> > - *                           static address
> > - *
> > - * @dev: device with which the DAA should be done
> > - *
> > - * Return: 0 in case of success, a negative error core otherwise.
> > - */
> > -int i3c_device_do_setdasa(struct i3c_device *dev)
> > -{
> > -	int ret;
> > -
> > -	i3c_bus_normaluse_lock(dev->bus);
> > -	ret = i3c_dev_setdasa_locked(dev->desc);
> > -	i3c_bus_normaluse_unlock(dev->bus);
> > -
> > -	return ret;
> > -}
> > -EXPORT_SYMBOL_GPL(i3c_device_do_setdasa);
> > -
> >  /**
> >   * i3c_device_get_info() - get I3C device information
> >   *
> > diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h
> > index 433f6088b7ce..842e1a865877 100644
> > --- a/drivers/i3c/internals.h
> > +++ b/drivers/i3c/internals.h
> > @@ -13,7 +13,6 @@
> >  void i3c_bus_normaluse_lock(struct i3c_bus *bus);
> >  void i3c_bus_normaluse_unlock(struct i3c_bus *bus);
> >  
> > -int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev);
> >  int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
> >  				 struct i3c_priv_xfer *xfers,
> >  				 int nxfers);
> > diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> > index 42310c9a00c2..000187339400 100644
> > --- a/drivers/i3c/master.c
> > +++ b/drivers/i3c/master.c
> > @@ -2916,25 +2916,6 @@ void i3c_master_unregister(struct i3c_master_controller *master)
> >  }
> >  EXPORT_SYMBOL_GPL(i3c_master_unregister);
> >  
> > -int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev)
> > -{
> > -	struct i3c_master_controller *master;
> > -
> > -	if (!dev)
> > -		return -ENOENT;
> > -
> > -	master = i3c_dev_get_master(dev);
> > -	if (!master)
> > -		return -EINVAL;
> > -
> > -	if (!dev->boardinfo || !dev->boardinfo->init_dyn_addr ||
> > -		!dev->boardinfo->static_addr)
> > -		return -EINVAL;
> > -
> > -	return i3c_master_setdasa_locked(master, dev->info.static_addr,
> > -						dev->boardinfo->init_dyn_addr);
> > -}
> > -
> >  int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
> >  				 struct i3c_priv_xfer *xfers,
> >  				 int nxfers)
> > diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h
> > index 0a8a44ac2f02..f4e924c179d7 100644
> > --- a/include/linux/i3c/device.h
> > +++ b/include/linux/i3c/device.h
> > @@ -301,8 +301,6 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
> >  			     struct i3c_priv_xfer *xfers,
> >  			     int nxfers);
> >  
> > -int i3c_device_do_setdasa(struct i3c_device *dev);
> > -
> >  void i3c_device_get_info(const struct i3c_device *dev, struct i3c_device_info *info);
> >  
> >  struct i3c_ibi_payload {
> > -- 
> > 2.47.1
> > 
> 
> -- 
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

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

* Re: [PATCH] i3c: Remove unused i3c_device_do_setdasa
  2025-01-12 22:54 ` Alexandre Belloni
  2025-01-12 22:57   ` Dr. David Alan Gilbert
@ 2025-01-13 10:00   ` Mukesh Kumar Savaliya
  1 sibling, 0 replies; 4+ messages in thread
From: Mukesh Kumar Savaliya @ 2025-01-13 10:00 UTC (permalink / raw)
  To: Alexandre Belloni, linux; +Cc: linux-i3c, linux-kernel



On 1/13/2025 4:24 AM, Alexandre Belloni wrote:
> Hello,
> 
> On 21/12/2024 14:34:18+0000, linux@treblig.org wrote:
>> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>>
>> i3c_device_do_setdasa() was added in 2022 as part of
>> commit 672825cd2823 ("i3c: export SETDASA method")
>>
>> but has been unused.
>>
>> It calls i3c_dev_setdasa_locked() which is now also unused.
>>
>> Remove them both.
I think there might be few drivers in future, which can use.
The function looks good to be used.
>> (This is effectively a revert of 672825cd2823).
>>
> 
> 
> Yeah, i guess this just means that we didn't see the device driver yet.
> I'm going to keep those function around for now.
> 
Agree here. We should keep this function as is.
>> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
>> ---
>>   drivers/i3c/device.c       | 20 --------------------
>>   drivers/i3c/internals.h    |  1 -
>>   drivers/i3c/master.c       | 19 -------------------
>>   include/linux/i3c/device.h |  2 --
>>   4 files changed, 42 deletions(-)
>>
>> diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c
>> index e80e48756914..984976f28314 100644
>> --- a/drivers/i3c/device.c
>> +++ b/drivers/i3c/device.c
>> @@ -54,26 +54,6 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
>>   }
>>   EXPORT_SYMBOL_GPL(i3c_device_do_priv_xfers);
>>   
>> -/**
>> - * i3c_device_do_setdasa() - do I3C dynamic address assignement with
>> - *                           static address
>> - *
>> - * @dev: device with which the DAA should be done
>> - *
>> - * Return: 0 in case of success, a negative error core otherwise.
>> - */
>> -int i3c_device_do_setdasa(struct i3c_device *dev)
>> -{
>> -	int ret;
>> -
>> -	i3c_bus_normaluse_lock(dev->bus);
>> -	ret = i3c_dev_setdasa_locked(dev->desc);
>> -	i3c_bus_normaluse_unlock(dev->bus);
>> -
>> -	return ret;
>> -}
>> -EXPORT_SYMBOL_GPL(i3c_device_do_setdasa);
>> -
>>   /**
>>    * i3c_device_get_info() - get I3C device information
>>    *
>> diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h
>> index 433f6088b7ce..842e1a865877 100644
>> --- a/drivers/i3c/internals.h
>> +++ b/drivers/i3c/internals.h
>> @@ -13,7 +13,6 @@
>>   void i3c_bus_normaluse_lock(struct i3c_bus *bus);
>>   void i3c_bus_normaluse_unlock(struct i3c_bus *bus);
>>   
>> -int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev);
>>   int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
>>   				 struct i3c_priv_xfer *xfers,
>>   				 int nxfers);
>> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
>> index 42310c9a00c2..000187339400 100644
>> --- a/drivers/i3c/master.c
>> +++ b/drivers/i3c/master.c
>> @@ -2916,25 +2916,6 @@ void i3c_master_unregister(struct i3c_master_controller *master)
>>   }
>>   EXPORT_SYMBOL_GPL(i3c_master_unregister);
>>   
>> -int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev)
>> -{
>> -	struct i3c_master_controller *master;
>> -
>> -	if (!dev)
>> -		return -ENOENT;
>> -
>> -	master = i3c_dev_get_master(dev);
>> -	if (!master)
>> -		return -EINVAL;
>> -
>> -	if (!dev->boardinfo || !dev->boardinfo->init_dyn_addr ||
>> -		!dev->boardinfo->static_addr)
>> -		return -EINVAL;
>> -
>> -	return i3c_master_setdasa_locked(master, dev->info.static_addr,
>> -						dev->boardinfo->init_dyn_addr);
>> -}
>> -
>>   int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
>>   				 struct i3c_priv_xfer *xfers,
>>   				 int nxfers)
>> diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h
>> index 0a8a44ac2f02..f4e924c179d7 100644
>> --- a/include/linux/i3c/device.h
>> +++ b/include/linux/i3c/device.h
>> @@ -301,8 +301,6 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
>>   			     struct i3c_priv_xfer *xfers,
>>   			     int nxfers);
>>   
>> -int i3c_device_do_setdasa(struct i3c_device *dev);
>> -
>>   void i3c_device_get_info(const struct i3c_device *dev, struct i3c_device_info *info);
>>   
>>   struct i3c_ibi_payload {
>> -- 
>> 2.47.1
>>
> 


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

end of thread, other threads:[~2025-01-13 10:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-21 14:34 [PATCH] i3c: Remove unused i3c_device_do_setdasa linux
2025-01-12 22:54 ` Alexandre Belloni
2025-01-12 22:57   ` Dr. David Alan Gilbert
2025-01-13 10:00   ` Mukesh Kumar Savaliya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).