diff mbox

[01/10] mfd/extcon: max77693: Remove unused extern declarations and max77693_dev members

Message ID 1430305114-23598-2-git-send-email-k.kozlowski.k@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Krzysztof Kozlowski April 29, 2015, 10:58 a.m. UTC
Clean up the max77693 private header file by removing:
1. Left-overs from previous way of interrupt handling (driver uses
   regmap_irq_chip).
2. Unused members of struct 'max77693_dev' related to interrupts in
   extcon driver.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
---
 drivers/extcon/extcon-max77693.c     | 4 ----
 include/linux/mfd/max77693-private.h | 8 --------
 2 files changed, 12 deletions(-)

Comments

Chanwoo Choi May 4, 2015, 6:45 a.m. UTC | #1
On 04/29/2015 07:58 PM, Krzysztof Kozlowski wrote:
> Clean up the max77693 private header file by removing:
> 1. Left-overs from previous way of interrupt handling (driver uses
>    regmap_irq_chip).
> 2. Unused members of struct 'max77693_dev' related to interrupts in
>    extcon driver.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
> ---
>  drivers/extcon/extcon-max77693.c     | 4 ----
>  include/linux/mfd/max77693-private.h | 8 --------
>  2 files changed, 12 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
> index a66bec8f6252..760e1e2cc1ce 100644
> --- a/drivers/extcon/extcon-max77693.c
> +++ b/drivers/extcon/extcon-max77693.c
> @@ -1218,10 +1218,6 @@ static int max77693_muic_probe(struct platform_device *pdev)
>  			irq_src = MUIC_INT3;
>  			break;
>  		}
> -
> -		if (irq_src < MAX77693_IRQ_GROUP_NR)
> -			info->max77693->irq_masks_cur[irq_src]
> -				= init_data[i].data;
>  	}

When removing the unused statement, I think you better to remove it as following:
because 'enum max77693_irq_source irq_src' is not used.

 	for (i = 0; i < num_init_data; i++) {
-		enum max77693_irq_source irq_src
-				= MAX77693_IRQ_GROUP_NR;
-
 		regmap_write(info->max77693->regmap_muic,
 				init_data[i].addr,
 				init_data[i].data);
-
-		switch (init_data[i].addr) {
-		case MAX77693_MUIC_REG_INTMASK1:
-			irq_src = MUIC_INT1;
-			break;
-		case MAX77693_MUIC_REG_INTMASK2:
-			irq_src = MUIC_INT2;
-			break;
-		case MAX77693_MUIC_REG_INTMASK3:
-			irq_src = MUIC_INT3;
-			break;
-		}
-
-		if (irq_src < MAX77693_IRQ_GROUP_NR)
-			info->max77693->irq_masks_cur[irq_src]
-				= init_data[i].data;
 	}
 
[snip]

Except for upper comment, Looks good to me.

Thanks,
Chanwoo Choi
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Krzysztof Kozlowski May 4, 2015, 6:49 a.m. UTC | #2
2015-05-04 15:45 GMT+09:00 Chanwoo Choi <cw00.choi@samsung.com>:
> On 04/29/2015 07:58 PM, Krzysztof Kozlowski wrote:
>> Clean up the max77693 private header file by removing:
>> 1. Left-overs from previous way of interrupt handling (driver uses
>>    regmap_irq_chip).
>> 2. Unused members of struct 'max77693_dev' related to interrupts in
>>    extcon driver.
>>
>> Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
>> ---
>>  drivers/extcon/extcon-max77693.c     | 4 ----
>>  include/linux/mfd/max77693-private.h | 8 --------
>>  2 files changed, 12 deletions(-)
>>
>> diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
>> index a66bec8f6252..760e1e2cc1ce 100644
>> --- a/drivers/extcon/extcon-max77693.c
>> +++ b/drivers/extcon/extcon-max77693.c
>> @@ -1218,10 +1218,6 @@ static int max77693_muic_probe(struct platform_device *pdev)
>>                       irq_src = MUIC_INT3;
>>                       break;
>>               }
>> -
>> -             if (irq_src < MAX77693_IRQ_GROUP_NR)
>> -                     info->max77693->irq_masks_cur[irq_src]
>> -                             = init_data[i].data;
>>       }
>
> When removing the unused statement, I think you better to remove it as following:
> because 'enum max77693_irq_source irq_src' is not used.

Yes, you're right. Actually some time ago I removed all of this:
extcon: max77693: Remove left-over code after switching to regmap irq chip
http://lkml.iu.edu/hypermail/linux/kernel/1410.2/03403.html

>
>         for (i = 0; i < num_init_data; i++) {
> -               enum max77693_irq_source irq_src
> -                               = MAX77693_IRQ_GROUP_NR;
> -
>                 regmap_write(info->max77693->regmap_muic,
>                                 init_data[i].addr,
>                                 init_data[i].data);
> -
> -               switch (init_data[i].addr) {
> -               case MAX77693_MUIC_REG_INTMASK1:
> -                       irq_src = MUIC_INT1;
> -                       break;
> -               case MAX77693_MUIC_REG_INTMASK2:
> -                       irq_src = MUIC_INT2;
> -                       break;
> -               case MAX77693_MUIC_REG_INTMASK3:
> -                       irq_src = MUIC_INT3;
> -                       break;
> -               }
> -
> -               if (irq_src < MAX77693_IRQ_GROUP_NR)
> -                       info->max77693->irq_masks_cur[irq_src]
> -                               = init_data[i].data;
>         }
>
> [snip]
>
> Except for upper comment, Looks good to me.

Okay, I'll do as you suggested and add your ack (in case it will go
through some other tree).

Thanks!
Krzysztof
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chanwoo Choi May 4, 2015, 6:54 a.m. UTC | #3
On 05/04/2015 03:49 PM, Krzysztof Koz?owski wrote:
> 2015-05-04 15:45 GMT+09:00 Chanwoo Choi <cw00.choi@samsung.com>:
>> On 04/29/2015 07:58 PM, Krzysztof Kozlowski wrote:
>>> Clean up the max77693 private header file by removing:
>>> 1. Left-overs from previous way of interrupt handling (driver uses
>>>    regmap_irq_chip).
>>> 2. Unused members of struct 'max77693_dev' related to interrupts in
>>>    extcon driver.
>>>
>>> Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
>>> ---
>>>  drivers/extcon/extcon-max77693.c     | 4 ----
>>>  include/linux/mfd/max77693-private.h | 8 --------
>>>  2 files changed, 12 deletions(-)
>>>
>>> diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
>>> index a66bec8f6252..760e1e2cc1ce 100644
>>> --- a/drivers/extcon/extcon-max77693.c
>>> +++ b/drivers/extcon/extcon-max77693.c
>>> @@ -1218,10 +1218,6 @@ static int max77693_muic_probe(struct platform_device *pdev)
>>>                       irq_src = MUIC_INT3;
>>>                       break;
>>>               }
>>> -
>>> -             if (irq_src < MAX77693_IRQ_GROUP_NR)
>>> -                     info->max77693->irq_masks_cur[irq_src]
>>> -                             = init_data[i].data;
>>>       }
>>
>> When removing the unused statement, I think you better to remove it as following:
>> because 'enum max77693_irq_source irq_src' is not used.
> 
> Yes, you're right. Actually some time ago I removed all of this:
> extcon: max77693: Remove left-over code after switching to regmap irq chip
> http://lkml.iu.edu/hypermail/linux/kernel/1410.2/03403.html
> 
>>
>>         for (i = 0; i < num_init_data; i++) {
>> -               enum max77693_irq_source irq_src
>> -                               = MAX77693_IRQ_GROUP_NR;
>> -
>>                 regmap_write(info->max77693->regmap_muic,
>>                                 init_data[i].addr,
>>                                 init_data[i].data);
>> -
>> -               switch (init_data[i].addr) {
>> -               case MAX77693_MUIC_REG_INTMASK1:
>> -                       irq_src = MUIC_INT1;
>> -                       break;
>> -               case MAX77693_MUIC_REG_INTMASK2:
>> -                       irq_src = MUIC_INT2;
>> -                       break;
>> -               case MAX77693_MUIC_REG_INTMASK3:
>> -                       irq_src = MUIC_INT3;
>> -                       break;
>> -               }
>> -
>> -               if (irq_src < MAX77693_IRQ_GROUP_NR)
>> -                       info->max77693->irq_masks_cur[irq_src]
>> -                               = init_data[i].data;
>>         }
>>
>> [snip]
>>
>> Except for upper comment, Looks good to me.
> 
> Okay, I'll do as you suggested and add your ack (in case it will go
> through some other tree).

I'm wondering the merge confilct if this patch will be merged on other tree.
Because extcon-max77693.c was already modified on extcon-next branch.

So, If the base commit of this patch is different, there are potential merge conflict.

Thanks,
Chanwoo Choi

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Krzysztof Kozlowski May 4, 2015, 7:01 a.m. UTC | #4
2015-05-04 15:54 GMT+09:00 Chanwoo Choi <cw00.choi@samsung.com>:
> On 05/04/2015 03:49 PM, Krzysztof Koz?owski wrote:
>> 2015-05-04 15:45 GMT+09:00 Chanwoo Choi <cw00.choi@samsung.com>:
>>> On 04/29/2015 07:58 PM, Krzysztof Kozlowski wrote:
>>>> Clean up the max77693 private header file by removing:
>>>> 1. Left-overs from previous way of interrupt handling (driver uses
>>>>    regmap_irq_chip).
>>>> 2. Unused members of struct 'max77693_dev' related to interrupts in
>>>>    extcon driver.
>>>>
>>>> Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
>>>> ---
>>>>  drivers/extcon/extcon-max77693.c     | 4 ----
>>>>  include/linux/mfd/max77693-private.h | 8 --------
>>>>  2 files changed, 12 deletions(-)
>>>>
>>>> diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
>>>> index a66bec8f6252..760e1e2cc1ce 100644
>>>> --- a/drivers/extcon/extcon-max77693.c
>>>> +++ b/drivers/extcon/extcon-max77693.c
>>>> @@ -1218,10 +1218,6 @@ static int max77693_muic_probe(struct platform_device *pdev)
>>>>                       irq_src = MUIC_INT3;
>>>>                       break;
>>>>               }
>>>> -
>>>> -             if (irq_src < MAX77693_IRQ_GROUP_NR)
>>>> -                     info->max77693->irq_masks_cur[irq_src]
>>>> -                             = init_data[i].data;
>>>>       }
>>>
>>> When removing the unused statement, I think you better to remove it as following:
>>> because 'enum max77693_irq_source irq_src' is not used.
>>
>> Yes, you're right. Actually some time ago I removed all of this:
>> extcon: max77693: Remove left-over code after switching to regmap irq chip
>> http://lkml.iu.edu/hypermail/linux/kernel/1410.2/03403.html
>>
>>>
>>>         for (i = 0; i < num_init_data; i++) {
>>> -               enum max77693_irq_source irq_src
>>> -                               = MAX77693_IRQ_GROUP_NR;
>>> -
>>>                 regmap_write(info->max77693->regmap_muic,
>>>                                 init_data[i].addr,
>>>                                 init_data[i].data);
>>> -
>>> -               switch (init_data[i].addr) {
>>> -               case MAX77693_MUIC_REG_INTMASK1:
>>> -                       irq_src = MUIC_INT1;
>>> -                       break;
>>> -               case MAX77693_MUIC_REG_INTMASK2:
>>> -                       irq_src = MUIC_INT2;
>>> -                       break;
>>> -               case MAX77693_MUIC_REG_INTMASK3:
>>> -                       irq_src = MUIC_INT3;
>>> -                       break;
>>> -               }
>>> -
>>> -               if (irq_src < MAX77693_IRQ_GROUP_NR)
>>> -                       info->max77693->irq_masks_cur[irq_src]
>>> -                               = init_data[i].data;
>>>         }
>>>
>>> [snip]
>>>
>>> Except for upper comment, Looks good to me.
>>
>> Okay, I'll do as you suggested and add your ack (in case it will go
>> through some other tree).
>
> I'm wondering the merge confilct if this patch will be merged on other tree.
> Because extcon-max77693.c was already modified on extcon-next branch.
>
> So, If the base commit of this patch is different, there are potential merge conflict.

Right, we can solve it by an immutable branch shared between trees. I
suspect that getting acks for whole patchset will take some time, so
the cleanups (few first patches) can be picked at beginning by
someone. Then, if needed, the maintainer can provide the branch for
other. Fortunately currently I don't see many conflicts between this
patch and extcon-next.

Best regards,
Krzysztof
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lee Jones May 5, 2015, 8:24 a.m. UTC | #5
On Wed, 29 Apr 2015, Krzysztof Kozlowski wrote:

> Clean up the max77693 private header file by removing:
> 1. Left-overs from previous way of interrupt handling (driver uses
>    regmap_irq_chip).
> 2. Unused members of struct 'max77693_dev' related to interrupts in
>    extcon driver.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
> ---
>  drivers/extcon/extcon-max77693.c     | 4 ----
>  include/linux/mfd/max77693-private.h | 8 --------

For the MFD changes:
  Acked-by: Lee Jones <lee.jones@linaro.org>
diff mbox

Patch

diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index a66bec8f6252..760e1e2cc1ce 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -1218,10 +1218,6 @@  static int max77693_muic_probe(struct platform_device *pdev)
 			irq_src = MUIC_INT3;
 			break;
 		}
-
-		if (irq_src < MAX77693_IRQ_GROUP_NR)
-			info->max77693->irq_masks_cur[irq_src]
-				= init_data[i].data;
 	}
 
 	if (pdata && pdata->muic_data) {
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
index 51633ea6f910..ad67b8235a8d 100644
--- a/include/linux/mfd/max77693-private.h
+++ b/include/linux/mfd/max77693-private.h
@@ -547,18 +547,10 @@  struct max77693_dev {
 	struct regmap_irq_chip_data *irq_data_muic;
 
 	int irq;
-	int irq_gpio;
-	struct mutex irqlock;
-	int irq_masks_cur[MAX77693_IRQ_GROUP_NR];
-	int irq_masks_cache[MAX77693_IRQ_GROUP_NR];
 };
 
 enum max77693_types {
 	TYPE_MAX77693,
 };
 
-extern int max77693_irq_init(struct max77693_dev *max77686);
-extern void max77693_irq_exit(struct max77693_dev *max77686);
-extern int max77693_irq_resume(struct max77693_dev *max77686);
-
 #endif /*  __LINUX_MFD_MAX77693_PRIV_H */