mbox

[GIT,PULL] mfd: regulator: S2MPA01 device support IB for Mark Brown

Message ID 20140318110947.GR25478@lee--X1
State Accepted, archived
Headers show

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-regulator-3.15

Message

Lee Jones March 18, 2014, 11:09 a.m. UTC
FAO Mark,

The following changes since commit 0414855fdc4a40da05221fc6062cccbc0c30f169:

  Linux 3.14-rc5 (2014-03-02 18:56:16 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-regulator-3.15

for you to fetch changes up to ba3e31f87e8b736adf01f1dc09cd5618966ee193:

  Documentation: mfd: Add binding document for S2MPA01 (2014-03-18 10:56:45 +0000)

----------------------------------------------------------------
Krzysztof Kozlowski (5):
      mfd: sec-core: Add maximum RTC register for regmap config
      mfd: sec-core: Select different RTC regmaps for devices
      mfd: sec-irq: Use consistent S2MPS11 RTC alarm interrupt indexes
      mfd: sec: Add support for S2MPS14
      mfd: sec-core: Fix possible NULL pointer dereference when i2c_new_dummy error

Pankaj Dubey (1):
      mfd: sec-core: Silence compiler warning

Sachin Kamat (3):
      mfd: Add support for S2MPA01 device
      regulator: Add support for S2MPA01 regulator
      Documentation: mfd: Add binding document for S2MPA01

 Documentation/devicetree/bindings/mfd/s2mpa01.txt |  90 ++++++++++++++++++++++++++
 drivers/mfd/sec-core.c                            | 112 +++++++++++++++++++++++++++++---
 drivers/mfd/sec-irq.c                             |  97 ++++++++++++++++++++++++++--
 drivers/regulator/Kconfig                         |   7 ++
 drivers/regulator/Makefile                        |   1 +
 drivers/regulator/s2mpa01.c                       | 481 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/samsung/core.h                  |  19 ++++--
 include/linux/mfd/samsung/irq.h                   |  81 +++++++++++++++++++++++-
 include/linux/mfd/samsung/rtc.h                   |  57 +++++++++++++++--
 include/linux/mfd/samsung/s2mpa01.h               | 192 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/samsung/s2mps14.h               | 152 ++++++++++++++++++++++++++++++++++++++++++++
 11 files changed, 1260 insertions(+), 29 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/s2mpa01.txt
 create mode 100644 drivers/regulator/s2mpa01.c
 create mode 100644 include/linux/mfd/samsung/s2mpa01.h
 create mode 100644 include/linux/mfd/samsung/s2mps14.h

Comments

Krzysztof Kozlowski March 18, 2014, 1:10 p.m. UTC | #1
Hi,

It seems that Sachin's and my patches (mfd: sec: Add support for
S2MPS14) are not in sync. Now the error appears:

drivers/mfd/sec-core.c:342:45: warning: ‘regmap_rtc’ may be used
uninitialized in this function [-Wuninitialized]

I'll send a quick fix for it but in a longterm the rtc-s5m driver should
initialize his regmap on his own.

Best regards,
Krzysztof

O
n Tue, 2014-03-18 at 11:09 +0000, Lee Jones wrote:
> FAO Mark,
> 
> The following changes since commit 0414855fdc4a40da05221fc6062cccbc0c30f169:
> 
>   Linux 3.14-rc5 (2014-03-02 18:56:16 -0800)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-regulator-3.15
> 
> for you to fetch changes up to ba3e31f87e8b736adf01f1dc09cd5618966ee193:
> 
>   Documentation: mfd: Add binding document for S2MPA01 (2014-03-18 10:56:45 +0000)
> 
> ----------------------------------------------------------------
> Krzysztof Kozlowski (5):
>       mfd: sec-core: Add maximum RTC register for regmap config
>       mfd: sec-core: Select different RTC regmaps for devices
>       mfd: sec-irq: Use consistent S2MPS11 RTC alarm interrupt indexes
>       mfd: sec: Add support for S2MPS14
>       mfd: sec-core: Fix possible NULL pointer dereference when i2c_new_dummy error
> 
> Pankaj Dubey (1):
>       mfd: sec-core: Silence compiler warning
> 
> Sachin Kamat (3):
>       mfd: Add support for S2MPA01 device
>       regulator: Add support for S2MPA01 regulator
>       Documentation: mfd: Add binding document for S2MPA01
> 
>  Documentation/devicetree/bindings/mfd/s2mpa01.txt |  90 ++++++++++++++++++++++++++
>  drivers/mfd/sec-core.c                            | 112 +++++++++++++++++++++++++++++---
>  drivers/mfd/sec-irq.c                             |  97 ++++++++++++++++++++++++++--
>  drivers/regulator/Kconfig                         |   7 ++
>  drivers/regulator/Makefile                        |   1 +
>  drivers/regulator/s2mpa01.c                       | 481 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/samsung/core.h                  |  19 ++++--
>  include/linux/mfd/samsung/irq.h                   |  81 +++++++++++++++++++++++-
>  include/linux/mfd/samsung/rtc.h                   |  57 +++++++++++++++--
>  include/linux/mfd/samsung/s2mpa01.h               | 192 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/samsung/s2mps14.h               | 152 ++++++++++++++++++++++++++++++++++++++++++++
>  11 files changed, 1260 insertions(+), 29 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mfd/s2mpa01.txt
>  create mode 100644 drivers/regulator/s2mpa01.c
>  create mode 100644 include/linux/mfd/samsung/s2mpa01.h
>  create mode 100644 include/linux/mfd/samsung/s2mps14.h
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sachin Kamat March 19, 2014, 8:27 a.m. UTC | #2
On 18 March 2014 18:41, Krzysztof Kozlowski <k.kozlowski@samsung.com> wrote:
> Initialize the 'regmap_rtc' on S2MPA01 to some sane value. Sane at least
> for S5M87X chipsets, not S2MPS/S2MPA but it won't be used because
> rtc-s5m driver does not support S2MPA01.
>
> This fixes following error:
> drivers/mfd/sec-core.c:342:45: warning: 'regmap_rtc' may be used uninitialized in this function [-Wuninitialized]
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

>From the point of suppressing this warning and considering how it is
done for S2MPS11,
Acked-by: Sachin Kamat <sachin.kamat@linaro.org>

However, shouldn't we be making this RTC handling conditional/optional
depending upon
whether the h/w or s/w supports/implements it?
Krzysztof Kozlowski March 19, 2014, 8:41 a.m. UTC | #3
On Wed, 2014-03-19 at 13:57 +0530, Sachin Kamat wrote:
> On 18 March 2014 18:41, Krzysztof Kozlowski <k.kozlowski@samsung.com> wrote:
> > Initialize the 'regmap_rtc' on S2MPA01 to some sane value. Sane at least
> > for S5M87X chipsets, not S2MPS/S2MPA but it won't be used because
> > rtc-s5m driver does not support S2MPA01.
> >
> > This fixes following error:
> > drivers/mfd/sec-core.c:342:45: warning: 'regmap_rtc' may be used uninitialized in this function [-Wuninitialized]
> >
> > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> 
> From the point of suppressing this warning and considering how it is
> done for S2MPS11,
> Acked-by: Sachin Kamat <sachin.kamat@linaro.org>
> 
> However, shouldn't we be making this RTC handling conditional/optional
> depending upon
> whether the h/w or s/w supports/implements it?

I think the rtc-s5m driver should instantiate his regmap on its own. The
same with i2c dummy device. This would remove problems with unsupported
chipsets by rtc-s5m driver.


Best regards,
Krzysztof

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lee Jones March 19, 2014, 9:14 a.m. UTC | #4
> Initialize the 'regmap_rtc' on S2MPA01 to some sane value. Sane at least
> for S5M87X chipsets, not S2MPS/S2MPA but it won't be used because
> rtc-s5m driver does not support S2MPA01.
> 
> This fixes following error:
> drivers/mfd/sec-core.c:342:45: warning: ‘regmap_rtc’ may be used uninitialized in this function [-Wuninitialized]
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
>  drivers/mfd/sec-core.c |    7 +++++++
>  1 file changed, 7 insertions(+)

Please don't send patches in the middle of threads like this (v2's are
a different story as it saves on re-sending entire patch-sets), as I
very nearly missed it.

We already have drivers doing similar things so I'll apply this as a
temporary fix, but please find something a little less 'hacky' to
supersede it _soon_.
Krzysztof Kozlowski March 19, 2014, 12:41 p.m. UTC | #5
On Wed, 2014-03-19 at 09:14 +0000, Lee Jones wrote:
> > Initialize the 'regmap_rtc' on S2MPA01 to some sane value. Sane at least
> > for S5M87X chipsets, not S2MPS/S2MPA but it won't be used because
> > rtc-s5m driver does not support S2MPA01.
> > 
> > This fixes following error:
> > drivers/mfd/sec-core.c:342:45: warning: ‘regmap_rtc’ may be used uninitialized in this function [-Wuninitialized]
> > 
> > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> > ---
> >  drivers/mfd/sec-core.c |    7 +++++++
> >  1 file changed, 7 insertions(+)
> 
> Please don't send patches in the middle of threads like this (v2's are
> a different story as it saves on re-sending entire patch-sets), as I
> very nearly missed it.

OK, I understand. I put it in the middle because it was a follow up of
your immutable branch ib-mfd-regulator-3.15 (merging mine S2MPS14 and
Sachin's S2MPA01).

> 
> We already have drivers doing similar things so I'll apply this as a
> temporary fix, but please find something a little less 'hacky' to
> supersede it _soon_.

Sure, I just sent a patch for it.

Best regards,
Krzysztof

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown March 19, 2014, 12:55 p.m. UTC | #6
On Tue, Mar 18, 2014 at 11:09:47AM +0000, Lee Jones wrote:

> are available in the git repository at:

>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-regulator-3.15

Pulled now, thanks - please use signed tags for pull requests, it's the
standard thing now and gets your changelog in the pull automatically
which is nice.
Lee Jones March 19, 2014, 1:47 p.m. UTC | #7
> > are available in the git repository at:
> 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-regulator-3.15
> 
> Pulled now, thanks - please use signed tags for pull requests, it's the
> standard thing now and gets your changelog in the pull automatically
> which is nice.

Sure, no problem.
Geert Uytterhoeven April 6, 2014, 1:23 p.m. UTC | #8
On Wed, Mar 19, 2014 at 9:27 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> On 18 March 2014 18:41, Krzysztof Kozlowski <k.kozlowski@samsung.com> wrote:
>> Initialize the 'regmap_rtc' on S2MPA01 to some sane value. Sane at least
>> for S5M87X chipsets, not S2MPS/S2MPA but it won't be used because
>> rtc-s5m driver does not support S2MPA01.
>>
>> This fixes following error:
>> drivers/mfd/sec-core.c:342:45: warning: 'regmap_rtc' may be used uninitialized in this function [-Wuninitialized]
>>
>> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>
> From the point of suppressing this warning and considering how it is
> done for S2MPS11,
> Acked-by: Sachin Kamat <sachin.kamat@linaro.org>

This is not just about suppressing a warning. The following may crash when
passed a random pointer:

sec_pmic->regmap_rtc = devm_regmap_init_i2c(sec_pmic->rtc, regmap_rtc);

and if regmap_rtc happens to be NULL, devm_regmap_init_i2c() will
return -EINVAL.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html