linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.
@ 2020-05-21 17:53 jic23
       [not found] ` <SA0PR12MB44290C81C03F7DAEE315DBFBC48B0@SA0PR12MB4429.namprd12.prod.outlook.com>
  0 siblings, 1 reply; 4+ messages in thread
From: jic23 @ 2020-05-21 17:53 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron, Jean-Baptiste Maneyrol

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

As this just calls dev_get_drvdata underneath which is happy with
a const struct device * we should change and avoid potentially
casting away a const in order to then put it back again.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
---
 include/linux/iio/iio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index a1be82e74c93..e846a0a7001e 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -669,7 +669,7 @@ static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
  *
  * Returns the data previously set with iio_device_set_drvdata()
  */
-static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
+static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev)
 {
 	return dev_get_drvdata(&indio_dev->dev);
 }
-- 
2.26.2


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

* Re: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.
       [not found] ` <SA0PR12MB44290C81C03F7DAEE315DBFBC48B0@SA0PR12MB4429.namprd12.prod.outlook.com>
@ 2020-06-06 14:24   ` Jonathan Cameron
  2020-06-08  9:43     ` Jean-Baptiste Maneyrol
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2020-06-06 14:24 UTC (permalink / raw)
  To: Jean-Baptiste Maneyrol; +Cc: linux-iio, Jonathan Cameron

On Tue, 2 Jun 2020 07:39:52 +0000
Jean-Baptiste Maneyrol <JManeyrol@invensense.com> wrote:

> Hi Jonathan,
> 
> simple and perfect.
> 
> Thanks,
> JB
> 
> Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>

Applied.


Thanks,

Jonathan

> 
> ________________________________
> From: jic23@kernel.org <jic23@kernel.org>
> Sent: Thursday, May 21, 2020 19:53
> To: linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>
> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>; Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
> Subject: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.
> 
>  CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> As this just calls dev_get_drvdata underneath which is happy with
> a const struct device * we should change and avoid potentially
> casting away a const in order to then put it back again.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
> ---
>  include/linux/iio/iio.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index a1be82e74c93..e846a0a7001e 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -669,7 +669,7 @@ static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
>   *
>   * Returns the data previously set with iio_device_set_drvdata()
>   */
> -static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
> +static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev)
>  {
>          return dev_get_drvdata(&indio_dev->dev);
>  }
> --
> 2.26.2
> 


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

* Re: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.
  2020-06-06 14:24   ` Jonathan Cameron
@ 2020-06-08  9:43     ` Jean-Baptiste Maneyrol
  2020-06-14 11:33       ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Baptiste Maneyrol @ 2020-06-08  9:43 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Jonathan Cameron

Hello Jonathan,

thanks a lot, but I'm currently not able to find this patch in iio git repository, neither in testing or fixes-togreg branches.

Is there something I am missing or I just have to wait more ?

Thanks,
JB


From: linux-iio-owner@vger.kernel.org <linux-iio-owner@vger.kernel.org> on behalf of Jonathan Cameron <jic23@kernel.org>
Sent: Saturday, June 6, 2020 16:24
To: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
Cc: linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>; Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *. 
 
 CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.

On Tue, 2 Jun 2020 07:39:52 +0000
Jean-Baptiste Maneyrol <JManeyrol@invensense.com> wrote:

> Hi Jonathan,
> 
> simple and perfect.
> 
> Thanks,
> JB
> 
> Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>

Applied.


Thanks,

Jonathan

> 
> ________________________________
> From: jic23@kernel.org <jic23@kernel.org>
> Sent: Thursday, May 21, 2020 19:53
> To: linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>
> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>; Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
> Subject: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.
> 
>  CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> As this just calls dev_get_drvdata underneath which is happy with
> a const struct device * we should change and avoid potentially
> casting away a const in order to then put it back again.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
> ---
>  include/linux/iio/iio.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index a1be82e74c93..e846a0a7001e 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -669,7 +669,7 @@ static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
>   *
>   * Returns the data previously set with iio_device_set_drvdata()
>   */
> -static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
> +static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev)
>  {
>          return dev_get_drvdata(&indio_dev->dev);
>  }
> --
> 2.26.2
> 

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

* Re: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.
  2020-06-08  9:43     ` Jean-Baptiste Maneyrol
@ 2020-06-14 11:33       ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2020-06-14 11:33 UTC (permalink / raw)
  To: Jean-Baptiste Maneyrol; +Cc: linux-iio, Jonathan Cameron

On Mon, 8 Jun 2020 09:43:26 +0000
Jean-Baptiste Maneyrol <JManeyrol@invensense.com> wrote:

> Hello Jonathan,
> 
> thanks a lot, but I'm currently not able to find this patch in iio git repository, neither in testing or fixes-togreg branches.
> 
> Is there something I am missing or I just have to wait more ?

I forgot to push out.  Did so mid week after I saw another
email saying things weren't there that should have been.

Given I've just rebased testing, I won't push out a togreg
branch until at least mid week to let the build reports come
in.

Thanks,

Jonathan

> 
> Thanks,
> JB
> 
> 
> From: linux-iio-owner@vger.kernel.org <linux-iio-owner@vger.kernel.org> on behalf of Jonathan Cameron <jic23@kernel.org>
> Sent: Saturday, June 6, 2020 16:24
> To: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
> Cc: linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>; Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Subject: Re: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *. 
>  
>  CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> On Tue, 2 Jun 2020 07:39:52 +0000
> Jean-Baptiste Maneyrol <JManeyrol@invensense.com> wrote:
> 
> > Hi Jonathan,
> > 
> > simple and perfect.
> > 
> > Thanks,
> > JB
> > 
> > Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>  
> 
> Applied.
> 
> 
> Thanks,
> 
> Jonathan
> 
> > 
> > ________________________________
> > From: jic23@kernel.org <jic23@kernel.org>
> > Sent: Thursday, May 21, 2020 19:53
> > To: linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>
> > Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>; Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
> > Subject: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.
> > 
> >  CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.
> > 
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > As this just calls dev_get_drvdata underneath which is happy with
> > a const struct device * we should change and avoid potentially
> > casting away a const in order to then put it back again.
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
> > ---
> >  include/linux/iio/iio.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> > index a1be82e74c93..e846a0a7001e 100644
> > --- a/include/linux/iio/iio.h
> > +++ b/include/linux/iio/iio.h
> > @@ -669,7 +669,7 @@ static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
> >   *
> >   * Returns the data previously set with iio_device_set_drvdata()
> >   */
> > -static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
> > +static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev)
> >  {
> >          return dev_get_drvdata(&indio_dev->dev);
> >  }
> > --
> > 2.26.2
> >   


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

end of thread, other threads:[~2020-06-14 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 17:53 [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev * jic23
     [not found] ` <SA0PR12MB44290C81C03F7DAEE315DBFBC48B0@SA0PR12MB4429.namprd12.prod.outlook.com>
2020-06-06 14:24   ` Jonathan Cameron
2020-06-08  9:43     ` Jean-Baptiste Maneyrol
2020-06-14 11:33       ` Jonathan Cameron

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).