All of lore.kernel.org
 help / color / mirror / Atom feed
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv3 3/6] pinctrl: gpio: vt8500: Add pincontrol driver for arch-vt8500
Date: Mon, 01 Apr 2013 13:02:52 -0600	[thread overview]
Message-ID: <5159D9DC.9070201@wwwdotorg.org> (raw)
In-Reply-To: <5159D92B.9020401@prisktech.co.nz>

On 04/01/2013 12:59 PM, Tony Prisk wrote:
> On 02/04/13 06:06, Stephen Warren wrote:
>> On 03/28/2013 12:10 AM, Tony Prisk wrote:
>>> This patch adds support for the GPIO/pinmux controller found on the VIA
>>> VT8500 and Wondermedia WM8xxx-series SoCs.
>>>
>>> Each pin within the controller is capable of operating as a GPIO or as
>>> an alternate function. The pins are numbered according to their control
>>> bank/bit so that if new pins are added, the existing numbering is
>>> maintained.
>>>
>>> All currently supported SoCs are included: VT8500, WM8505, WM8650,
>>> WM8750 and
>>> WM8850.

>>> diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c

>>> +static int wmt_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
>>> +                   struct device_node *np,
>>> +                   struct pinctrl_map **map,
>>> +                   unsigned *num_maps)
>>> +fail:
>>> +    kfree(maps);
>>> +    return err;
>>> +}
>
>> There, I think you also want to iterate over maps[] and free
>> map->data.configs.config for any PIN_MAP_TYPE_CONFIGS_PIN.
>>
>> Perhaps just call wmt_pctl_dt_free_map() here, with roughly nmaps =
>> cur_map - maps?
>
> I have dropped the kfree() and used devm_kzalloc instead. Makes the fail
> path tidier as well.

Does the pinctrl core guarantee that the map table entries get removed
when unregistering the pincontrol driver? If it does, I guess that
change is safe. If not, perhaps not. I guess it must though.

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren@wwwdotorg.org>
To: Tony Prisk <linux@prisktech.co.nz>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	vt8500-wm8505-linux-kernel@googlegroups.com, arnd@arndb.de,
	olof@lixom.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCHv3 3/6] pinctrl: gpio: vt8500: Add pincontrol driver for arch-vt8500
Date: Mon, 01 Apr 2013 13:02:52 -0600	[thread overview]
Message-ID: <5159D9DC.9070201@wwwdotorg.org> (raw)
In-Reply-To: <5159D92B.9020401@prisktech.co.nz>

On 04/01/2013 12:59 PM, Tony Prisk wrote:
> On 02/04/13 06:06, Stephen Warren wrote:
>> On 03/28/2013 12:10 AM, Tony Prisk wrote:
>>> This patch adds support for the GPIO/pinmux controller found on the VIA
>>> VT8500 and Wondermedia WM8xxx-series SoCs.
>>>
>>> Each pin within the controller is capable of operating as a GPIO or as
>>> an alternate function. The pins are numbered according to their control
>>> bank/bit so that if new pins are added, the existing numbering is
>>> maintained.
>>>
>>> All currently supported SoCs are included: VT8500, WM8505, WM8650,
>>> WM8750 and
>>> WM8850.

>>> diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c

>>> +static int wmt_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
>>> +                   struct device_node *np,
>>> +                   struct pinctrl_map **map,
>>> +                   unsigned *num_maps)
>>> +fail:
>>> +    kfree(maps);
>>> +    return err;
>>> +}
>
>> There, I think you also want to iterate over maps[] and free
>> map->data.configs.config for any PIN_MAP_TYPE_CONFIGS_PIN.
>>
>> Perhaps just call wmt_pctl_dt_free_map() here, with roughly nmaps =
>> cur_map - maps?
>
> I have dropped the kfree() and used devm_kzalloc instead. Makes the fail
> path tidier as well.

Does the pinctrl core guarantee that the map table entries get removed
when unregistering the pincontrol driver? If it does, I guess that
change is safe. If not, perhaps not. I guess it must though.

  reply	other threads:[~2013-04-01 19:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28  6:10 [PATCHv3 0/6] arm: vt8500: Add support for pinctrl/gpio module Tony Prisk
2013-03-28  6:10 ` Tony Prisk
2013-03-28  6:10 ` [PATCHv3 1/6] of: Add support for reading a u32 from a multi-value property Tony Prisk
2013-03-28  6:10   ` Tony Prisk
2013-04-01 16:49   ` Stephen Warren
2013-04-01 16:49     ` Stephen Warren
2013-03-28  6:10 ` [PATCHv3 2/6] arm: vt8500: Increase available GPIOs on arch-vt8500 Tony Prisk
2013-03-28  6:10   ` Tony Prisk
2013-03-28  6:10 ` [PATCHv3 3/6] pinctrl: gpio: vt8500: Add pincontrol driver for arch-vt8500 Tony Prisk
2013-03-28  6:10   ` Tony Prisk
2013-04-01 17:06   ` Stephen Warren
2013-04-01 17:06     ` Stephen Warren
2013-04-01 18:59     ` Tony Prisk
2013-04-01 18:59       ` Tony Prisk
2013-04-01 19:02       ` Stephen Warren [this message]
2013-04-01 19:02         ` Stephen Warren
2013-03-28  6:10 ` [PATCHv3 4/6] arm: dts: vt8500: Update Wondermedia SoC dtsi files for pinctrl driver Tony Prisk
2013-03-28  6:10   ` Tony Prisk
2013-03-28  6:10 ` [PATCHv3 5/6] arm: vt8500: Remove gpio devicetree nodes Tony Prisk
2013-03-28  6:10   ` Tony Prisk
2013-03-28  6:10 ` [PATCHv3 6/6] gpio: vt8500: Remove arch-vt8500 gpio driver Tony Prisk
2013-03-28  6:10   ` Tony Prisk

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=5159D9DC.9070201@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.