Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1492094 > unrolled thread

Re: [PATCH v5 1/4] mfd: mxs-lradc: Add support for mxs-lradc MFD

Started byLee Jones <lee.jones@linaro.org>
First post2016-09-27 20:50 +0200
Last post2016-09-29 02:00 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v5 1/4] mfd: mxs-lradc: Add support for mxs-lradc MFD Lee Jones <lee.jones@linaro.org> - 2016-09-27 20:50 +0200
    Re: [PATCH v5 1/4] mfd: mxs-lradc: Add support for mxs-lradc MFD Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-09-28 04:10 +0200
      Re: [PATCH v5 1/4] mfd: mxs-lradc: Add support for mxs-lradc MFD Lee Jones <lee.jones@linaro.org> - 2016-09-29 02:00 +0200

#1492094 — Re: [PATCH v5 1/4] mfd: mxs-lradc: Add support for mxs-lradc MFD

FromLee Jones <lee.jones@linaro.org>
Date2016-09-27 20:50 +0200
SubjectRe: [PATCH v5 1/4] mfd: mxs-lradc: Add support for mxs-lradc MFD
Message-ID<sm5C1-4Dm-11@gated-at.bofh.it>
On Sat, 17 Sep 2016, Ksenija Stanojević wrote:
> On Wed, Aug 31, 2016 at 2:05 PM, Lee Jones <lee.jones@linaro.org> wrote:
> > On Thu, 18 Aug 2016, Ksenija Stanojevic wrote:
> >
> > > Add core files for mxs-lradc MFD driver.
> > >
> > > Note:  this patch won't compile in iio/testing without this patch:
> > > a8f447be8056 ("mfd: Add resource managed APIs for mfd_add_devices")
> > >
> > > Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
> > > ---
> > > Changes in v5:
> > >  - use DEFINE_RES_MEM
> > >  - don't pass ioreammaped adress to platform cells
> > >  - move comment outside of struct mxs_lradc
> > >  - change type of argument in mxs_lradc_reg_set, mxs_lradc_reg_clear,
> > >    mxs_lradc_reg_wrt (struct mxs_lradc * -> void __iomem *)
> > >
> > > Changes in v4:
> > >  - update copyright
> > >  - use DEFINE_RES_IRQ_NAMED
> > >  - remove mxs_lradc_add_device function
> > >  - use struct mfd_cell in static form
> > >  - improve spacing
> > >  - remove unnecessary comment
> > >  - remove platform_get_irq
> > >  - remove touch_ret and use ret instead
> > >  - rename use_touchscreen to touchscreen_wire
> > >  - use goto statements
> > >  - remove irq[13], irq_count and irq_name from struct mxs_lradc
> > >  - remove all defines from inside the struct definition
> > >
> > > Changes in v3:
> > >  - add note to commit message
> > >  - move switch statement into if(touch_ret == 0) branch
> > >  - add MODULE_AUTHOR
> > >
> > > Changes in v2:
> > >  - do not change spacing in Kconfig
> > >  - make struct mfd_cell part of struct mxs_lradc
> > >  - use switch instead of if in mxs_lradc_irq_mask
> > >  - use only necessary header files in mxs_lradc.h
> > >  - use devm_mfd_add_device
> > >  - use separate function to register mfd device
> > >  - change licence to GPL
> > >  - add copyright
> > >
> > >  drivers/mfd/Kconfig           |  17 +++
> > >  drivers/mfd/Makefile          |   1 +
> > >  drivers/mfd/mxs-lradc.c       | 255 ++++++++++++++++++++++++++++++++++++++++++
> > >  include/linux/mfd/mxs-lradc.h | 194 ++++++++++++++++++++++++++++++++
> > >  4 files changed, 467 insertions(+)
> > >  create mode 100644 drivers/mfd/mxs-lradc.c
> > >  create mode 100644 include/linux/mfd/mxs-lradc.h

[...]

> > > +static int mxs_lradc_probe(struct platform_device *pdev)
> > > +{
> > > +     const struct of_device_id *of_id;
> > > +     struct device *dev = &pdev->dev;
> > > +     struct device_node *node = dev->of_node;
> > > +     struct mxs_lradc *lradc;
> > > +     struct mfd_cell *cells = NULL;
> > > +     int ret = 0;
> > > +     u32 ts_wires = 0;
> > > +
> > > +     lradc = devm_kzalloc(&pdev->dev, sizeof(*lradc), GFP_KERNEL);
> > > +     if (!lradc)
> > > +             return -ENOMEM;
> > > +
> > > +     of_id = of_match_device(mxs_lradc_dt_ids, &pdev->dev);
> > > +     lradc->soc = (enum mxs_lradc_id)of_id->data;
> >
> > Unnecessary cast.
> 
> If I remove the cast I get this error:
> drivers/mfd/mxs-lradc.c:148:13: error: incompatible types when
> assigning to type ‘enum mxs_lradc_id’ from type ‘const void * const’

Ah, because it's a const.  Fair enough.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [next] | [standalone]


#1492235

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2016-09-28 04:10 +0200
Message-ID<smctP-CI-3@gated-at.bofh.it>
In reply to#1492094
On September 27, 2016 11:50:00 AM PDT, Lee Jones <lee.jones@linaro.org> wrote:
>On Sat, 17 Sep 2016, Ksenija Stanojević wrote:
>> On Wed, Aug 31, 2016 at 2:05 PM, Lee Jones <lee.jones@linaro.org>
>wrote:
>> > On Thu, 18 Aug 2016, Ksenija Stanojevic wrote:
>> >
>> > > Add core files for mxs-lradc MFD driver.
>> > >
>> > > Note:  this patch won't compile in iio/testing without this
>patch:
>> > > a8f447be8056 ("mfd: Add resource managed APIs for
>mfd_add_devices")
>> > >
>> > > Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
>> > > ---
>> > > Changes in v5:
>> > >  - use DEFINE_RES_MEM
>> > >  - don't pass ioreammaped adress to platform cells
>> > >  - move comment outside of struct mxs_lradc
>> > >  - change type of argument in mxs_lradc_reg_set,
>mxs_lradc_reg_clear,
>> > >    mxs_lradc_reg_wrt (struct mxs_lradc * -> void __iomem *)
>> > >
>> > > Changes in v4:
>> > >  - update copyright
>> > >  - use DEFINE_RES_IRQ_NAMED
>> > >  - remove mxs_lradc_add_device function
>> > >  - use struct mfd_cell in static form
>> > >  - improve spacing
>> > >  - remove unnecessary comment
>> > >  - remove platform_get_irq
>> > >  - remove touch_ret and use ret instead
>> > >  - rename use_touchscreen to touchscreen_wire
>> > >  - use goto statements
>> > >  - remove irq[13], irq_count and irq_name from struct mxs_lradc
>> > >  - remove all defines from inside the struct definition
>> > >
>> > > Changes in v3:
>> > >  - add note to commit message
>> > >  - move switch statement into if(touch_ret == 0) branch
>> > >  - add MODULE_AUTHOR
>> > >
>> > > Changes in v2:
>> > >  - do not change spacing in Kconfig
>> > >  - make struct mfd_cell part of struct mxs_lradc
>> > >  - use switch instead of if in mxs_lradc_irq_mask
>> > >  - use only necessary header files in mxs_lradc.h
>> > >  - use devm_mfd_add_device
>> > >  - use separate function to register mfd device
>> > >  - change licence to GPL
>> > >  - add copyright
>> > >
>> > >  drivers/mfd/Kconfig           |  17 +++
>> > >  drivers/mfd/Makefile          |   1 +
>> > >  drivers/mfd/mxs-lradc.c       | 255
>++++++++++++++++++++++++++++++++++++++++++
>> > >  include/linux/mfd/mxs-lradc.h | 194
>++++++++++++++++++++++++++++++++
>> > >  4 files changed, 467 insertions(+)
>> > >  create mode 100644 drivers/mfd/mxs-lradc.c
>> > >  create mode 100644 include/linux/mfd/mxs-lradc.h
>
>[...]
>
>> > > +static int mxs_lradc_probe(struct platform_device *pdev)
>> > > +{
>> > > +     const struct of_device_id *of_id;
>> > > +     struct device *dev = &pdev->dev;
>> > > +     struct device_node *node = dev->of_node;
>> > > +     struct mxs_lradc *lradc;
>> > > +     struct mfd_cell *cells = NULL;
>> > > +     int ret = 0;
>> > > +     u32 ts_wires = 0;
>> > > +
>> > > +     lradc = devm_kzalloc(&pdev->dev, sizeof(*lradc),
>GFP_KERNEL);
>> > > +     if (!lradc)
>> > > +             return -ENOMEM;
>> > > +
>> > > +     of_id = of_match_device(mxs_lradc_dt_ids, &pdev->dev);
>> > > +     lradc->soc = (enum mxs_lradc_id)of_id->data;
>> >
>> > Unnecessary cast.
>> 
>> If I remove the cast I get this error:
>> drivers/mfd/mxs-lradc.c:148:13: error: incompatible types when
>> assigning to type ‘enum mxs_lradc_id’ from type ‘const void * const’
>
>Ah, because it's a const.  Fair enough.

No, it's because void * has to be cast to a non-pointer data type explicitly.


Thanks.

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1493061

FromLee Jones <lee.jones@linaro.org>
Date2016-09-29 02:00 +0200
Message-ID<smwVz-4Z7-5@gated-at.bofh.it>
In reply to#1492235
On Tue, 27 Sep 2016, Dmitry Torokhov wrote:

> On September 27, 2016 11:50:00 AM PDT, Lee Jones <lee.jones@linaro.org> wrote:
> >On Sat, 17 Sep 2016, Ksenija Stanojević wrote:
> >> On Wed, Aug 31, 2016 at 2:05 PM, Lee Jones <lee.jones@linaro.org>
> >wrote:
> >> > On Thu, 18 Aug 2016, Ksenija Stanojevic wrote:
> >> >
> >> > > Add core files for mxs-lradc MFD driver.
> >> > >
> >> > > Note:  this patch won't compile in iio/testing without this
> >patch:
> >> > > a8f447be8056 ("mfd: Add resource managed APIs for
> >mfd_add_devices")
> >> > >
> >> > > Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
> >> > > ---
> >> > > Changes in v5:
> >> > >  - use DEFINE_RES_MEM
> >> > >  - don't pass ioreammaped adress to platform cells
> >> > >  - move comment outside of struct mxs_lradc
> >> > >  - change type of argument in mxs_lradc_reg_set,
> >mxs_lradc_reg_clear,
> >> > >    mxs_lradc_reg_wrt (struct mxs_lradc * -> void __iomem *)
> >> > >
> >> > > Changes in v4:
> >> > >  - update copyright
> >> > >  - use DEFINE_RES_IRQ_NAMED
> >> > >  - remove mxs_lradc_add_device function
> >> > >  - use struct mfd_cell in static form
> >> > >  - improve spacing
> >> > >  - remove unnecessary comment
> >> > >  - remove platform_get_irq
> >> > >  - remove touch_ret and use ret instead
> >> > >  - rename use_touchscreen to touchscreen_wire
> >> > >  - use goto statements
> >> > >  - remove irq[13], irq_count and irq_name from struct mxs_lradc
> >> > >  - remove all defines from inside the struct definition
> >> > >
> >> > > Changes in v3:
> >> > >  - add note to commit message
> >> > >  - move switch statement into if(touch_ret == 0) branch
> >> > >  - add MODULE_AUTHOR
> >> > >
> >> > > Changes in v2:
> >> > >  - do not change spacing in Kconfig
> >> > >  - make struct mfd_cell part of struct mxs_lradc
> >> > >  - use switch instead of if in mxs_lradc_irq_mask
> >> > >  - use only necessary header files in mxs_lradc.h
> >> > >  - use devm_mfd_add_device
> >> > >  - use separate function to register mfd device
> >> > >  - change licence to GPL
> >> > >  - add copyright
> >> > >
> >> > >  drivers/mfd/Kconfig           |  17 +++
> >> > >  drivers/mfd/Makefile          |   1 +
> >> > >  drivers/mfd/mxs-lradc.c       | 255
> >++++++++++++++++++++++++++++++++++++++++++
> >> > >  include/linux/mfd/mxs-lradc.h | 194
> >++++++++++++++++++++++++++++++++
> >> > >  4 files changed, 467 insertions(+)
> >> > >  create mode 100644 drivers/mfd/mxs-lradc.c
> >> > >  create mode 100644 include/linux/mfd/mxs-lradc.h
> >
> >[...]
> >
> >> > > +static int mxs_lradc_probe(struct platform_device *pdev)
> >> > > +{
> >> > > +     const struct of_device_id *of_id;
> >> > > +     struct device *dev = &pdev->dev;
> >> > > +     struct device_node *node = dev->of_node;
> >> > > +     struct mxs_lradc *lradc;
> >> > > +     struct mfd_cell *cells = NULL;
> >> > > +     int ret = 0;
> >> > > +     u32 ts_wires = 0;
> >> > > +
> >> > > +     lradc = devm_kzalloc(&pdev->dev, sizeof(*lradc),
> >GFP_KERNEL);
> >> > > +     if (!lradc)
> >> > > +             return -ENOMEM;
> >> > > +
> >> > > +     of_id = of_match_device(mxs_lradc_dt_ids, &pdev->dev);
> >> > > +     lradc->soc = (enum mxs_lradc_id)of_id->data;
> >> >
> >> > Unnecessary cast.
> >> 
> >> If I remove the cast I get this error:
> >> drivers/mfd/mxs-lradc.c:148:13: error: incompatible types when
> >> assigning to type ‘enum mxs_lradc_id’ from type ‘const void * const’
> >
> >Ah, because it's a const.  Fair enough.
> 
> No, it's because void * has to be cast to a non-pointer data type explicitly.

You're right.  My bad!  I was getting confused by the fact that you
don't need to cast when you allocate a value *to* a void *.  Senior
moment, please ignore!

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web