From: Sangjung <sangjung.woo@samsung.com>
To: Chanwoo Choi <cwchoi00@gmail.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Seung-Woo Kim <sw0312.kim@samsung.com>
Subject: Re: [PATCHv2 8/8] extcon: arizona: Use devm_extcon_dev_register()
Date: Fri, 18 Apr 2014 09:09:53 +0900 [thread overview]
Message-ID: <53506D51.2070808@samsung.com> (raw)
In-Reply-To: <CAGTfZH0m0YT0Dj7ZavrFrTe-h5J49DausNWnEtcRxxEmqtr3KQ@mail.gmail.com>
Hi Chanwoo.
On 04/18/2014 12:29 AM, Chanwoo Choi wrote:
> Hi Sangjung,
>
> Seung-Woo reviewed this patch previously but, He didn't send
> reviewed-by message as reply.
> After received reviewed-by message, I think that we should add it on
> patch description.
Frankly speaking, I didn't know the basic acknowledge procedure of Linux
Kernel development.
Thank you for your advice.
I will add the _reviewed-by_ message after I get it from Seung-woo.
BRs,
Sangjung
> Thanks,
> Chanwoo Choi
>
> On Thu, Apr 17, 2014 at 7:10 PM, Sangjung Woo <sangjung.woo@samsung.com> wrote:
>> Use the resource-managed extcon device register function (i.e.
>> devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
>> is attached with this function, that extcon device is automatically unregistered
>> on driver detach. That reduces tiresome managing code.
>>
>> Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
>> Reviewed-by: Seung-Woo Kim <sw0312.kim@samsung.com>
>> ---
>> drivers/extcon/extcon-arizona.c | 13 ++++---------
>> 1 file changed, 4 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
>> index 98a14f6..40e6c0b 100644
>> --- a/drivers/extcon/extcon-arizona.c
>> +++ b/drivers/extcon/extcon-arizona.c
>> @@ -1105,15 +1105,13 @@ static int arizona_extcon_probe(struct platform_device *pdev)
>> info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
>> if (!info) {
>> dev_err(&pdev->dev, "Failed to allocate memory\n");
>> - ret = -ENOMEM;
>> - goto err;
>> + return -ENOMEM;
>> }
>>
>> info->micvdd = devm_regulator_get(arizona->dev, "MICVDD");
>> if (IS_ERR(info->micvdd)) {
>> - ret = PTR_ERR(info->micvdd);
>> dev_err(arizona->dev, "Failed to get MICVDD: %d\n", ret);
>> - goto err;
>> + return PTR_ERR(info->micvdd);
>> }
>>
>> mutex_init(&info->lock);
>> @@ -1155,11 +1153,11 @@ static int arizona_extcon_probe(struct platform_device *pdev)
>> info->edev.dev.parent = arizona->dev;
>> info->edev.supported_cable = arizona_cable;
>>
>> - ret = extcon_dev_register(&info->edev);
>> + ret = devm_extcon_dev_register(&pdev->dev, &info->edev);
>> if (ret < 0) {
>> dev_err(arizona->dev, "extcon_dev_register() failed: %d\n",
>> ret);
>> - goto err;
>> + return ret;
>> }
>>
>> info->input = devm_input_allocate_device(&pdev->dev);
>> @@ -1410,8 +1408,6 @@ err_rise:
>> err_input:
>> err_register:
>> pm_runtime_disable(&pdev->dev);
>> - extcon_dev_unregister(&info->edev);
>> -err:
>> return ret;
>> }
>>
>> @@ -1445,7 +1441,6 @@ static int arizona_extcon_remove(struct platform_device *pdev)
>> regmap_update_bits(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE,
>> ARIZONA_JD1_ENA, 0);
>> arizona_clk32k_disable(arizona);
>> - extcon_dev_unregister(&info->edev);
>>
>> return 0;
>> }
>> --
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
prev parent reply other threads:[~2014-04-18 0:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-17 10:09 [PATCHv2 0/8] Resource-managed extcon device register function Sangjung Woo
2014-04-17 10:09 ` [PATCHv2 1/8] extcon: Add resource-managed extcon " Sangjung Woo
2014-04-17 15:26 ` Chanwoo Choi
2014-04-18 0:12 ` Sangjung
2014-04-17 10:09 ` [PATCHv2 2/8] extcon: adc-jack: Use devm_extcon_dev_register() Sangjung Woo
2014-04-17 10:09 ` [PATCHv3 3/8] extcon: gpio: " Sangjung Woo
2014-04-17 10:09 ` [PATCHv2 4/8] extcon: max14577: " Sangjung Woo
2014-04-17 10:10 ` [PATCHv2 5/8] extcon: max77693: " Sangjung Woo
2014-04-17 10:10 ` [PATCHv2 6/8] extcon: max8997: " Sangjung Woo
2014-04-17 10:10 ` [PATCHv2 7/8] extcon: palmas: " Sangjung Woo
2014-04-17 10:10 ` [PATCHv2 8/8] extcon: arizona: " Sangjung Woo
2014-04-17 15:29 ` Chanwoo Choi
2014-04-18 0:09 ` Sangjung [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53506D51.2070808@samsung.com \
--to=sangjung.woo@samsung.com \
--cc=cw00.choi@samsung.com \
--cc=cwchoi00@gmail.com \
--cc=k.kozlowski@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=sw0312.kim@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.