diff mbox series

[2/2] iio: adc: adi-axi-adc: Remove unneeded check

Message ID 20200701120442.258-2-nuno.sa@analog.com (mailing list archive)
State New, archived
Headers show
Series [1/2] iio: adc: adi-axi-adc: Fix object reference counting | expand

Commit Message

Nuno Sa July 1, 2020, 12:04 p.m. UTC
Looking at the register path, there will be bigger issues if `dev` is
NULL. Hence, we can drop this check and assume there's no way that `dev`
can be NULL at this point.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
---
 drivers/iio/adc/adi-axi-adc.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Alexandru Ardelean July 1, 2020, 1:57 p.m. UTC | #1
On Wed, 2020-07-01 at 14:04 +0200, Nuno Sá wrote:
> [External]
> 
> Looking at the register path, there will be bigger issues if `dev` is
> NULL. Hence, we can drop this check and assume there's no way that `dev`
> can be NULL at this point.
> 
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> ---
>  drivers/iio/adc/adi-axi-adc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-
> adc.c
> index 86b6b65916ee..e216e37e8c8c 100644
> --- a/drivers/iio/adc/adi-axi-adc.c
> +++ b/drivers/iio/adc/adi-axi-adc.c
> @@ -326,9 +326,6 @@ static struct adi_axi_adc_client
> *adi_axi_adc_attach_client(struct device *dev)
>  	mutex_lock(&registered_clients_lock);
>  
>  	list_for_each_entry(cl, &registered_clients, entry) {
> -		if (!cl->dev)
> -			continue;
> -

I may need to check this again.
I think this may be a left-over, of when there was un-managed
adi_axi_adc_conv_register()


>  		if (cl->dev->of_node != cln)
>  			continue;
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
index 86b6b65916ee..e216e37e8c8c 100644
--- a/drivers/iio/adc/adi-axi-adc.c
+++ b/drivers/iio/adc/adi-axi-adc.c
@@ -326,9 +326,6 @@  static struct adi_axi_adc_client *adi_axi_adc_attach_client(struct device *dev)
 	mutex_lock(&registered_clients_lock);
 
 	list_for_each_entry(cl, &registered_clients, entry) {
-		if (!cl->dev)
-			continue;
-
 		if (cl->dev->of_node != cln)
 			continue;