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 |
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(®istered_clients_lock); > > list_for_each_entry(cl, ®istered_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 --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(®istered_clients_lock); list_for_each_entry(cl, ®istered_clients, entry) { - if (!cl->dev) - continue; - if (cl->dev->of_node != cln) continue;
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(-)