* [PATCH] mfd: sec-irq: fix support for devices without irq specified @ 2014-08-07 16:42 Bartlomiej Zolnierkiewicz 2014-08-07 16:48 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 5+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2014-08-07 16:42 UTC (permalink / raw) To: Samuel Ortiz, Lee Jones Cc: Krzysztof Kozlowski, Sangbeom Kim, Kyungmin Park, linux-kernel Add missing check for the case of device without irq specified in sec_irq_exit() (please note that sec_irq_init() already correctly handles such devices). This is needed for Insignal's Exynos4412 based Origen board. Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> Cc: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> --- patch is against next-20140804 branch of linux-next kernel drivers/mfd/sec-irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c index f9a5786..b65a7f0 100644 --- a/drivers/mfd/sec-irq.c +++ b/drivers/mfd/sec-irq.c @@ -478,5 +478,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) void sec_irq_exit(struct sec_pmic_dev *sec_pmic) { - regmap_del_irq_chip(sec_pmic->irq, sec_pmic->irq_data); + if (sec_pmic->irq) + regmap_del_irq_chip(sec_pmic->irq, sec_pmic->irq_data); } -- 1.8.2.3 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mfd: sec-irq: fix support for devices without irq specified 2014-08-07 16:42 [PATCH] mfd: sec-irq: fix support for devices without irq specified Bartlomiej Zolnierkiewicz @ 2014-08-07 16:48 ` Bartlomiej Zolnierkiewicz 2014-08-08 7:34 ` Krzysztof Kozlowski 0 siblings, 1 reply; 5+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2014-08-07 16:48 UTC (permalink / raw) To: Samuel Ortiz Cc: Lee Jones, Krzysztof Kozlowski, Sangbeom Kim, Kyungmin Park, linux-kernel, linux-samsung-soc [ added missing linux-samsung-soc ML, sorry for the noise ] On Thursday, August 07, 2014 06:42:28 PM Bartlomiej Zolnierkiewicz wrote: > Add missing check for the case of device without irq specified > in sec_irq_exit() (please note that sec_irq_init() already > correctly handles such devices). > > This is needed for Insignal's Exynos4412 based Origen board. > > Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> > Cc: Sangbeom Kim <sbkim73@samsung.com> > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > Acked-by: Kyungmin Park <kyungmin.park@samsung.com> > --- > patch is against next-20140804 branch of linux-next kernel > > drivers/mfd/sec-irq.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c > index f9a5786..b65a7f0 100644 > --- a/drivers/mfd/sec-irq.c > +++ b/drivers/mfd/sec-irq.c > @@ -478,5 +478,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) > > void sec_irq_exit(struct sec_pmic_dev *sec_pmic) > { > - regmap_del_irq_chip(sec_pmic->irq, sec_pmic->irq_data); > + if (sec_pmic->irq) > + regmap_del_irq_chip(sec_pmic->irq, sec_pmic->irq_data); > } ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mfd: sec-irq: fix support for devices without irq specified 2014-08-07 16:48 ` Bartlomiej Zolnierkiewicz @ 2014-08-08 7:34 ` Krzysztof Kozlowski 2014-08-08 7:48 ` Krzysztof Kozlowski 0 siblings, 1 reply; 5+ messages in thread From: Krzysztof Kozlowski @ 2014-08-08 7:34 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz Cc: Samuel Ortiz, Lee Jones, Sangbeom Kim, Kyungmin Park, linux-kernel, linux-samsung-soc On czw, 2014-08-07 at 18:48 +0200, Bartlomiej Zolnierkiewicz wrote: > [ added missing linux-samsung-soc ML, sorry for the noise ] > > On Thursday, August 07, 2014 06:42:28 PM Bartlomiej Zolnierkiewicz wrote: > > Add missing check for the case of device without irq specified > > in sec_irq_exit() (please note that sec_irq_init() already > > correctly handles such devices). > > > > This is needed for Insignal's Exynos4412 based Origen board. > > > > Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> > > Cc: Sangbeom Kim <sbkim73@samsung.com> > > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > Acked-by: Kyungmin Park <kyungmin.park@samsung.com> > > --- > > patch is against next-20140804 branch of linux-next kernel > > > > drivers/mfd/sec-irq.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) Looks and works good (tested on board with S2MPS14). Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Best regards, Krzysztof > > > > diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c > > index f9a5786..b65a7f0 100644 > > --- a/drivers/mfd/sec-irq.c > > +++ b/drivers/mfd/sec-irq.c > > @@ -478,5 +478,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) > > > > void sec_irq_exit(struct sec_pmic_dev *sec_pmic) > > { > > - regmap_del_irq_chip(sec_pmic->irq, sec_pmic->irq_data); > > + if (sec_pmic->irq) > > + regmap_del_irq_chip(sec_pmic->irq, sec_pmic->irq_data); > > } ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mfd: sec-irq: fix support for devices without irq specified 2014-08-08 7:34 ` Krzysztof Kozlowski @ 2014-08-08 7:48 ` Krzysztof Kozlowski 2014-08-08 12:44 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 5+ messages in thread From: Krzysztof Kozlowski @ 2014-08-08 7:48 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz Cc: Samuel Ortiz, Lee Jones, Sangbeom Kim, Kyungmin Park, linux-kernel, linux-samsung-soc On pią, 2014-08-08 at 09:34 +0200, Krzysztof Kozlowski wrote: > On czw, 2014-08-07 at 18:48 +0200, Bartlomiej Zolnierkiewicz wrote: > > [ added missing linux-samsung-soc ML, sorry for the noise ] > > > > On Thursday, August 07, 2014 06:42:28 PM Bartlomiej Zolnierkiewicz wrote: > > > Add missing check for the case of device without irq specified > > > in sec_irq_exit() (please note that sec_irq_init() already > > > correctly handles such devices). > > > > > > This is needed for Insignal's Exynos4412 based Origen board. > > > > > > Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> > > > Cc: Sangbeom Kim <sbkim73@samsung.com> > > > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > > Acked-by: Kyungmin Park <kyungmin.park@samsung.com> > > > --- > > > patch is against next-20140804 branch of linux-next kernel > > > > > > drivers/mfd/sec-irq.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > Looks and works good (tested on board with S2MPS14). > > Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> > Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> > > Best regards, > Krzysztof > > > > > > > diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c > > > index f9a5786..b65a7f0 100644 > > > --- a/drivers/mfd/sec-irq.c > > > +++ b/drivers/mfd/sec-irq.c > > > @@ -478,5 +478,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) > > > > > > void sec_irq_exit(struct sec_pmic_dev *sec_pmic) > > > { > > > - regmap_del_irq_chip(sec_pmic->irq, sec_pmic->irq_data); > > > + if (sec_pmic->irq) > > > + regmap_del_irq_chip(sec_pmic->irq, sec_pmic->irq_data); > > > } Seems I jumped too far with this one. Patch looks OK and works fine but is it really needed? If (!sec_pmic->irq) then sec_pmic->irq_data will be NULL and regmap_del_irq_chip() will handle it correctly. Your change adds some sense of precautions (the sec_pmic->irq_data may be set by some other module by mistake) but still it does not look like "needed" for Origen. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mfd: sec-irq: fix support for devices without irq specified 2014-08-08 7:48 ` Krzysztof Kozlowski @ 2014-08-08 12:44 ` Bartlomiej Zolnierkiewicz 0 siblings, 0 replies; 5+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2014-08-08 12:44 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Samuel Ortiz, Lee Jones, Sangbeom Kim, Kyungmin Park, linux-kernel, linux-samsung-soc On Friday, August 08, 2014 09:48:56 AM Krzysztof Kozlowski wrote: > On pią, 2014-08-08 at 09:34 +0200, Krzysztof Kozlowski wrote: > > On czw, 2014-08-07 at 18:48 +0200, Bartlomiej Zolnierkiewicz wrote: > > > [ added missing linux-samsung-soc ML, sorry for the noise ] > > > > > > On Thursday, August 07, 2014 06:42:28 PM Bartlomiej Zolnierkiewicz wrote: > > > > Add missing check for the case of device without irq specified > > > > in sec_irq_exit() (please note that sec_irq_init() already > > > > correctly handles such devices). > > > > > > > > This is needed for Insignal's Exynos4412 based Origen board. > > > > > > > > Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> > > > > Cc: Sangbeom Kim <sbkim73@samsung.com> > > > > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> > > > > Acked-by: Kyungmin Park <kyungmin.park@samsung.com> > > > > --- > > > > patch is against next-20140804 branch of linux-next kernel > > > > > > > > drivers/mfd/sec-irq.c | 3 ++- > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > Looks and works good (tested on board with S2MPS14). > > > > Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> > > Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> > > > > Best regards, > > Krzysztof > > > > > > > > > > diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c > > > > index f9a5786..b65a7f0 100644 > > > > --- a/drivers/mfd/sec-irq.c > > > > +++ b/drivers/mfd/sec-irq.c > > > > @@ -478,5 +478,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) > > > > > > > > void sec_irq_exit(struct sec_pmic_dev *sec_pmic) > > > > { > > > > - regmap_del_irq_chip(sec_pmic->irq, sec_pmic->irq_data); > > > > + if (sec_pmic->irq) > > > > + regmap_del_irq_chip(sec_pmic->irq, sec_pmic->irq_data); > > > > } > > Seems I jumped too far with this one. Patch looks OK and works fine but > is it really needed? If (!sec_pmic->irq) then sec_pmic->irq_data will be > NULL and regmap_del_irq_chip() will handle it correctly. > > Your change adds some sense of precautions (the sec_pmic->irq_data may > be set by some other module by mistake) but still it does not look like > "needed" for Origen. Indeed, I somehow assumed that regmap_del_irq_chip() doesn't check for NULL 'struct regmap_irq_chip_data *d' argument. Since such check is actually present in regmap_del_irq_chip() the patch is not needed and can be dropped. Thanks for noticing this. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-08-08 12:44 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-08-07 16:42 [PATCH] mfd: sec-irq: fix support for devices without irq specified Bartlomiej Zolnierkiewicz 2014-08-07 16:48 ` Bartlomiej Zolnierkiewicz 2014-08-08 7:34 ` Krzysztof Kozlowski 2014-08-08 7:48 ` Krzysztof Kozlowski 2014-08-08 12:44 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox