diff options
author | Bjorn Andersson <bjorn.andersson@sonymobile.com> | 2013-12-15 02:01:53 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-12-16 04:32:50 -0500 |
commit | 408e3c66da700a2c30ec63e0c4078c23d28dac2f (patch) | |
tree | beacbbd2aa31e53597b8d86b6ec34d95d454f7d8 /drivers/pinctrl/pinctrl-msm.c | |
parent | f393e489c79d55dcc8e72eed0fabcb061e6b0090 (diff) |
pinctrl-msm: Remove separate allocation of bitmaps
Make the bitmaps part of the msm_pinctrl allocation instead of
separately allocating them.
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-msm.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-msm.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/drivers/pinctrl/pinctrl-msm.c b/drivers/pinctrl/pinctrl-msm.c index c1a3053ff4c7..011e26334077 100644 --- a/drivers/pinctrl/pinctrl-msm.c +++ b/drivers/pinctrl/pinctrl-msm.c | |||
@@ -36,6 +36,8 @@ | |||
36 | #include "pinctrl-msm.h" | 36 | #include "pinctrl-msm.h" |
37 | #include "pinctrl-utils.h" | 37 | #include "pinctrl-utils.h" |
38 | 38 | ||
39 | #define MAX_NR_GPIO 300 | ||
40 | |||
39 | /** | 41 | /** |
40 | * struct msm_pinctrl - state for a pinctrl-msm device | 42 | * struct msm_pinctrl - state for a pinctrl-msm device |
41 | * @dev: device handle. | 43 | * @dev: device handle. |
@@ -61,9 +63,9 @@ struct msm_pinctrl { | |||
61 | 63 | ||
62 | spinlock_t lock; | 64 | spinlock_t lock; |
63 | 65 | ||
64 | unsigned long *enabled_irqs; | 66 | DECLARE_BITMAP(dual_edge_irqs, MAX_NR_GPIO); |
65 | unsigned long *dual_edge_irqs; | 67 | DECLARE_BITMAP(enabled_irqs, MAX_NR_GPIO); |
66 | unsigned long *wake_irqs; | 68 | DECLARE_BITMAP(wake_irqs, MAX_NR_GPIO); |
67 | 69 | ||
68 | const struct msm_pinctrl_soc_data *soc; | 70 | const struct msm_pinctrl_soc_data *soc; |
69 | void __iomem *regs; | 71 | void __iomem *regs; |
@@ -875,30 +877,6 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl) | |||
875 | chip->owner = THIS_MODULE; | 877 | chip->owner = THIS_MODULE; |
876 | chip->of_node = pctrl->dev->of_node; | 878 | chip->of_node = pctrl->dev->of_node; |
877 | 879 | ||
878 | pctrl->enabled_irqs = devm_kzalloc(pctrl->dev, | ||
879 | sizeof(unsigned long) * BITS_TO_LONGS(chip->ngpio), | ||
880 | GFP_KERNEL); | ||
881 | if (!pctrl->enabled_irqs) { | ||
882 | dev_err(pctrl->dev, "Failed to allocate enabled_irqs bitmap\n"); | ||
883 | return -ENOMEM; | ||
884 | } | ||
885 | |||
886 | pctrl->dual_edge_irqs = devm_kzalloc(pctrl->dev, | ||
887 | sizeof(unsigned long) * BITS_TO_LONGS(chip->ngpio), | ||
888 | GFP_KERNEL); | ||
889 | if (!pctrl->dual_edge_irqs) { | ||
890 | dev_err(pctrl->dev, "Failed to allocate dual_edge_irqs bitmap\n"); | ||
891 | return -ENOMEM; | ||
892 | } | ||
893 | |||
894 | pctrl->wake_irqs = devm_kzalloc(pctrl->dev, | ||
895 | sizeof(unsigned long) * BITS_TO_LONGS(chip->ngpio), | ||
896 | GFP_KERNEL); | ||
897 | if (!pctrl->wake_irqs) { | ||
898 | dev_err(pctrl->dev, "Failed to allocate wake_irqs bitmap\n"); | ||
899 | return -ENOMEM; | ||
900 | } | ||
901 | |||
902 | ret = gpiochip_add(&pctrl->chip); | 880 | ret = gpiochip_add(&pctrl->chip); |
903 | if (ret) { | 881 | if (ret) { |
904 | dev_err(pctrl->dev, "Failed register gpiochip\n"); | 882 | dev_err(pctrl->dev, "Failed register gpiochip\n"); |