pinctrl: imx: use struct imx_pinctrl_soc_info as a const
For some SoCs the struct imx_pinctrl_soc_info is passed through
of_device_id.data which is const. Most variables are already const
or otherwise not written. However, some fields are modified at
runtime. Move those fields to the dynamically allocated struct
imx_pinctrl.
Fixes: b3060044e4
("pinctrl: freescale: imx7d: make of_device_ids const")
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:

committed by
Linus Walleij

parent
32e21f084f
commit
f5843492ec
@@ -58,14 +58,10 @@ struct imx_cfg_params_decode {
|
||||
};
|
||||
|
||||
struct imx_pinctrl_soc_info {
|
||||
struct device *dev;
|
||||
const struct pinctrl_pin_desc *pins;
|
||||
unsigned int npins;
|
||||
struct imx_pin_reg *pin_regs;
|
||||
unsigned int group_index;
|
||||
unsigned int flags;
|
||||
const char *gpr_compatible;
|
||||
struct mutex mutex;
|
||||
|
||||
/* MUX_MODE shift and mask in case SHARE_MUX_CONF_REG */
|
||||
unsigned int mux_mask;
|
||||
@@ -95,7 +91,10 @@ struct imx_pinctrl {
|
||||
struct pinctrl_dev *pctl;
|
||||
void __iomem *base;
|
||||
void __iomem *input_sel_base;
|
||||
struct imx_pinctrl_soc_info *info;
|
||||
const struct imx_pinctrl_soc_info *info;
|
||||
struct imx_pin_reg *pin_regs;
|
||||
unsigned int group_index;
|
||||
struct mutex mutex;
|
||||
};
|
||||
|
||||
#define IMX_CFG_PARAMS_DECODE(p, m, o) \
|
||||
@@ -117,5 +116,5 @@ struct imx_pinctrl {
|
||||
#define IOMUXC_CONFIG_SION (0x1 << 4)
|
||||
|
||||
int imx_pinctrl_probe(struct platform_device *pdev,
|
||||
struct imx_pinctrl_soc_info *info);
|
||||
const struct imx_pinctrl_soc_info *info);
|
||||
#endif /* __DRIVERS_PINCTRL_IMX_H */
|
||||
|
Reference in New Issue
Block a user