public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] soc: mtk-pmic-wrap: make of_device_ids const.
@ 2017-06-28  4:58 Arvind Yadav
  2017-06-28 12:10 ` chen.zhong
  0 siblings, 1 reply; 3+ messages in thread
From: Arvind Yadav @ 2017-06-28  4:58 UTC (permalink / raw)
  To: linux-arm-kernel

of_device_ids are not supposed to change at runtime. All functions
working with of_device_ids provided by <linux/of.h> work with const
of_device_ids. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/soc/mediatek/mtk-pmic-wrap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index a5f1093..1205a671 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -1067,7 +1067,7 @@ static irqreturn_t pwrap_interrupt(int irqno, void *dev_id)
 	.init_soc_specific = pwrap_mt2701_init_soc_specific,
 };
 
-static struct pmic_wrapper_type pwrap_mt8135 = {
+static const struct pmic_wrapper_type pwrap_mt8135 = {
 	.regs = mt8135_regs,
 	.type = PWRAP_MT8135,
 	.arb_en_all = 0x1ff,
@@ -1079,7 +1079,7 @@ static irqreturn_t pwrap_interrupt(int irqno, void *dev_id)
 	.init_soc_specific = pwrap_mt8135_init_soc_specific,
 };
 
-static struct pmic_wrapper_type pwrap_mt8173 = {
+static const struct pmic_wrapper_type pwrap_mt8173 = {
 	.regs = mt8173_regs,
 	.type = PWRAP_MT8173,
 	.arb_en_all = 0x3f,
@@ -1091,7 +1091,7 @@ static irqreturn_t pwrap_interrupt(int irqno, void *dev_id)
 	.init_soc_specific = pwrap_mt8173_init_soc_specific,
 };
 
-static struct of_device_id of_pwrap_match_tbl[] = {
+static const struct of_device_id of_pwrap_match_tbl[] = {
 	{
 		.compatible = "mediatek,mt2701-pwrap",
 		.data = &pwrap_mt2701,
-- 
1.9.1

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

* [PATCH] soc: mtk-pmic-wrap: make of_device_ids const.
  2017-06-28  4:58 [PATCH] soc: mtk-pmic-wrap: make of_device_ids const Arvind Yadav
@ 2017-06-28 12:10 ` chen.zhong
  2017-08-02 10:39   ` Matthias Brugger
  0 siblings, 1 reply; 3+ messages in thread
From: chen.zhong @ 2017-06-28 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,
On Wed, 2017-06-28 at 10:28 +0530, Arvind Yadav wrote:
> of_device_ids are not supposed to change at runtime. All functions
> working with of_device_ids provided by <linux/of.h> work with const
> of_device_ids. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/soc/mediatek/mtk-pmic-wrap.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
> index a5f1093..1205a671 100644
> --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
> +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
> @@ -1067,7 +1067,7 @@ static irqreturn_t pwrap_interrupt(int irqno, void *dev_id)
>  	.init_soc_specific = pwrap_mt2701_init_soc_specific,
>  };
>  
> -static struct pmic_wrapper_type pwrap_mt8135 = {
> +static const struct pmic_wrapper_type pwrap_mt8135 = {
>  	.regs = mt8135_regs,
>  	.type = PWRAP_MT8135,
>  	.arb_en_all = 0x1ff,
> @@ -1079,7 +1079,7 @@ static irqreturn_t pwrap_interrupt(int irqno, void *dev_id)
>  	.init_soc_specific = pwrap_mt8135_init_soc_specific,
>  };
>  
> -static struct pmic_wrapper_type pwrap_mt8173 = {
> +static const struct pmic_wrapper_type pwrap_mt8173 = {
>  	.regs = mt8173_regs,
>  	.type = PWRAP_MT8173,
>  	.arb_en_all = 0x3f,
> @@ -1091,7 +1091,7 @@ static irqreturn_t pwrap_interrupt(int irqno, void *dev_id)
>  	.init_soc_specific = pwrap_mt8173_init_soc_specific,
>  };
>  
> -static struct of_device_id of_pwrap_match_tbl[] = {
> +static const struct of_device_id of_pwrap_match_tbl[] = {
>  	{
>  		.compatible = "mediatek,mt2701-pwrap",
>  		.data = &pwrap_mt2701,

Acked-by: Chen Zhong <chen.zhong@mediatek.com>

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

* [PATCH] soc: mtk-pmic-wrap: make of_device_ids const.
  2017-06-28 12:10 ` chen.zhong
@ 2017-08-02 10:39   ` Matthias Brugger
  0 siblings, 0 replies; 3+ messages in thread
From: Matthias Brugger @ 2017-08-02 10:39 UTC (permalink / raw)
  To: linux-arm-kernel



On 06/28/2017 02:10 PM, chen.zhong wrote:
> Hi,
> On Wed, 2017-06-28 at 10:28 +0530, Arvind Yadav wrote:
>> of_device_ids are not supposed to change at runtime. All functions
>> working with of_device_ids provided by <linux/of.h> work with const
>> of_device_ids. So mark the non-const structs as const.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
>>   drivers/soc/mediatek/mtk-pmic-wrap.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
>> index a5f1093..1205a671 100644
>> --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
>> +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
>> @@ -1067,7 +1067,7 @@ static irqreturn_t pwrap_interrupt(int irqno, void *dev_id)
>>   	.init_soc_specific = pwrap_mt2701_init_soc_specific,
>>   };
>>   
>> -static struct pmic_wrapper_type pwrap_mt8135 = {
>> +static const struct pmic_wrapper_type pwrap_mt8135 = {
>>   	.regs = mt8135_regs,
>>   	.type = PWRAP_MT8135,
>>   	.arb_en_all = 0x1ff,
>> @@ -1079,7 +1079,7 @@ static irqreturn_t pwrap_interrupt(int irqno, void *dev_id)
>>   	.init_soc_specific = pwrap_mt8135_init_soc_specific,
>>   };
>>   
>> -static struct pmic_wrapper_type pwrap_mt8173 = {
>> +static const struct pmic_wrapper_type pwrap_mt8173 = {
>>   	.regs = mt8173_regs,
>>   	.type = PWRAP_MT8173,
>>   	.arb_en_all = 0x3f,
>> @@ -1091,7 +1091,7 @@ static irqreturn_t pwrap_interrupt(int irqno, void *dev_id)
>>   	.init_soc_specific = pwrap_mt8173_init_soc_specific,
>>   };
>>   
>> -static struct of_device_id of_pwrap_match_tbl[] = {
>> +static const struct of_device_id of_pwrap_match_tbl[] = {
>>   	{
>>   		.compatible = "mediatek,mt2701-pwrap",
>>   		.data = &pwrap_mt2701,
> 
> Acked-by: Chen Zhong <chen.zhong@mediatek.com>
> 

Applied to v4.13-next/soc

Thanks a lot,
Matthias

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

end of thread, other threads:[~2017-08-02 10:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-28  4:58 [PATCH] soc: mtk-pmic-wrap: make of_device_ids const Arvind Yadav
2017-06-28 12:10 ` chen.zhong
2017-08-02 10:39   ` Matthias Brugger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox