mfd: sec-irq: fix support for devices without irq specified
Subsystems (3)
PATCH 1/1 mfd: sec-irq: fix support for devices without irq specified
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.
---
patch is against next-20140804 branch of linux-next kernel
drivers/mfd/sec-irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mfd/sec-irq.c +2 -1
@@ -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); }
Signature · 1 line
1.8.2.3
[ added missing linux-samsung-soc ML, sorry for the noise ]
Quoted 28 lines · Bartlomiej Zolnierkiewicz
Add missing check for the case of device without irq specified in
sec_irq_exit()(please note thatsec_irq_init()already correctly handles such devices).This is needed for Insignal's Exynos4412 based Origen board.
Cc Krzysztof Kozlowski <[email protected]>Cc Sangbeom Kim <[email protected]>Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>Acked-by Kyungmin Park <[email protected]>---
patch is against next-20140804 branch of linux-next kerneldrivers/mfd/sec-irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mfd/sec-irq.c +2
-1@@ -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); }
Quoted 18 lines · Bartlomiej Zolnierkiewicz
[ added missing linux-samsung-soc ML, sorry for the noise ]
Quoted 15 lines · Bartlomiej Zolnierkiewicz
Add missing check for the case of device without irq specified in
sec_irq_exit()(please note thatsec_irq_init()already correctly handles such devices).This is needed for Insignal's Exynos4412 based Origen board.
Cc Krzysztof Kozlowski <[email protected]>Cc Sangbeom Kim <[email protected]>Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>Acked-by Kyungmin Park <[email protected]>---
patch is against next-20140804 branch of linux-next kerneldrivers/mfd/sec-irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Looks and works good (tested on board with S2MPS14).
Best regards,
Krzysztof
Quoted 13 lines
Quoted 13 lines
drivers/mfd/sec-irq.c +2
-1@@ -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); }
Quoted 34 lines · Krzysztof Kozlowski
Quoted 18 lines · Bartlomiej Zolnierkiewicz
[ added missing linux-samsung-soc ML, sorry for the noise ]
Quoted 15 lines · Bartlomiej Zolnierkiewicz
Add missing check for the case of device without irq specified in
sec_irq_exit()(please note thatsec_irq_init()already correctly handles such devices).This is needed for Insignal's Exynos4412 based Origen board.
Cc Krzysztof Kozlowski <[email protected]>Cc Sangbeom Kim <[email protected]>Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>Acked-by Kyungmin Park <[email protected]>---
patch is against next-20140804 branch of linux-next kerneldrivers/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 <[email protected]>Tested-by Krzysztof Kozlowski <[email protected]>Best regards,
KrzysztofQuoted 7 lines
Quoted 7 lines
drivers/mfd/sec-irq.c +0
-0@@ -478,5 +478,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
Quoted 6 lines
Quoted 6 lines
drivers/mfd/sec-irq.c int sec_irq_init(struct sec_pmic_dev *sec_pmic) · line 483
Quoted 6 lines
drivers/mfd/sec-irq.c +2
-1void 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
Quoted 46 lines · Krzysztof Kozlowski
Quoted 34 lines · Krzysztof Kozlowski
Quoted 18 lines · Bartlomiej Zolnierkiewicz
[ added missing linux-samsung-soc ML, sorry for the noise ]
Quoted 15 lines · Bartlomiej Zolnierkiewicz
Add missing check for the case of device without irq specified in
sec_irq_exit()(please note thatsec_irq_init()already correctly handles such devices).This is needed for Insignal's Exynos4412 based Origen board.
Cc Krzysztof Kozlowski <[email protected]>Cc Sangbeom Kim <[email protected]>Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>Acked-by Kyungmin Park <[email protected]>---
patch is against next-20140804 branch of linux-next kerneldrivers/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 <[email protected]>Tested-by Krzysztof Kozlowski <[email protected]>Best regards,
KrzysztofQuoted 7 lines
Quoted 7 lines
drivers/mfd/sec-irq.c +0
-0@@ -478,5 +478,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)Quoted 6 lines
Quoted 6 lines
drivers/mfd/sec-irq.c int sec_irq_init(struct sec_pmic_dev *sec_pmic) · line 483
Quoted 6 lines
drivers/mfd/sec-irq.c +2
-1void 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_datawill be NULL andregmap_del_irq_chip()will handle it correctly.
Quoted 3 lines
Your change adds some sense of precautions (the
sec_pmic->irq_datamay 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