usb: musb: core: added missing const qualifier to musb_hdrc_platform_data::config

The musb_hdrc_platform_data::config was defined as a non-const pointer.
However some drivers (e.g. the ux500) set up this pointer to point to a
static structure, which is potentially dangerous. Since the musb core
uses the pointer in a read-only manner the const qualifier was added to
protect the content of the config.

Signed-off-by: Petr Kulhavy <petr@barix.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
This commit is contained in:
Petr Kulhavy 2016-02-24 16:27:16 +01:00 коммит произвёл Felipe Balbi
Родитель b02038faa7
Коммит ead22caf85
3 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -1901,7 +1901,7 @@ static void musb_recover_from_babble(struct musb *musb)
*/ */
static struct musb *allocate_instance(struct device *dev, static struct musb *allocate_instance(struct device *dev,
struct musb_hdrc_config *config, void __iomem *mbase) const struct musb_hdrc_config *config, void __iomem *mbase)
{ {
struct musb *musb; struct musb *musb;
struct musb_hw_ep *ep; struct musb_hw_ep *ep;

Просмотреть файл

@ -438,7 +438,7 @@ struct musb {
*/ */
unsigned double_buffer_not_ok:1; unsigned double_buffer_not_ok:1;
struct musb_hdrc_config *config; const struct musb_hdrc_config *config;
int xceiv_old_state; int xceiv_old_state;
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS

Просмотреть файл

@ -124,7 +124,7 @@ struct musb_hdrc_platform_data {
int (*set_power)(int state); int (*set_power)(int state);
/* MUSB configuration-specific details */ /* MUSB configuration-specific details */
struct musb_hdrc_config *config; const struct musb_hdrc_config *config;
/* Architecture specific board data */ /* Architecture specific board data */
void *board_data; void *board_data;