Re: [PATCH 2/4] pinctrl: Remove unsafe __refdata

From: Barry Song
Date: Thu Oct 20 2011 - 05:46:28 EST


2011/10/20 Stephen Warren <swarren@xxxxxxxxxx>:
> A pin controller's pin definitions are used both during pinctrl_register()
> and pinctrl_unregister(). The latter happens outside of __init/__devinit
> time, and hence it is unsafe to mark the pin array as __refdata.

Thanks.
Acked-by: Barry Song <Baohua.Song@xxxxxxx>

missed this when porting prima2 pinmux driver. is this __refdata used
just due to a typo?
i don't find prima2 pinctrl_pin_desc tables uses any code/data in __init/__exit.

if we need the table to be in init section, we should have used
__initconst/__initdata instead.

>
> Signed-off-by: Stephen Warren <swarren@xxxxxxxxxx>
> ---
> Âdrivers/pinctrl/pinmux-sirf.c | Â Â2 +-
> Âdrivers/pinctrl/pinmux-u300.c | Â Â2 +-
> Â2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/pinmux-sirf.c b/drivers/pinctrl/pinmux-sirf.c
> index cad4f5d..3bc083c 100644
> --- a/drivers/pinctrl/pinmux-sirf.c
> +++ b/drivers/pinctrl/pinmux-sirf.c
> @@ -30,7 +30,7 @@
> Â* pad list for the pinmux subsystem
> Â* refer to CS-131858-DC-6A.xls
> Â*/
> -static const struct pinctrl_pin_desc __refdata sirfsoc_pads[] = {
> +static const struct pinctrl_pin_desc sirfsoc_pads[] = {
> Â Â Â ÂPINCTRL_PIN(4, "pwm0"),
> Â Â Â ÂPINCTRL_PIN(5, "pwm1"),
> Â Â Â ÂPINCTRL_PIN(6, "pwm2"),
> diff --git a/drivers/pinctrl/pinmux-u300.c b/drivers/pinctrl/pinmux-u300.c
> index be6e04d..ed8bcd8 100644
> --- a/drivers/pinctrl/pinmux-u300.c
> +++ b/drivers/pinctrl/pinmux-u300.c
> @@ -179,7 +179,7 @@
> Â#define U300_NUM_PADS 467
>
> Â/* Pad names for the pinmux subsystem */
> -static const struct pinctrl_pin_desc __refdata u300_pads[] = {
> +static const struct pinctrl_pin_desc u300_pads[] = {
> Â Â Â Â/* Pads along the top edge of the chip */
> Â Â Â ÂPINCTRL_PIN(0, "P PAD VDD 28"),
> Â Â Â ÂPINCTRL_PIN(1, "P PAD GND 28"),
> --
> 1.7.0.4

-barry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/