mfd: intel_quark_i2c_gpio: Don't play dirty trick with const
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 26 Mar 2021 12:48:42 +0000 (14:48 +0200)
committerLee Jones <lee.jones@linaro.org>
Wed, 14 Apr 2021 15:06:35 +0000 (16:06 +0100)
commit6dac44c602bef283484ca84591396e65f8d8f1a5
treec4583da616a538864434e66bbf1780ef11e94575
parent91076ebb3e2204cbb81aa2d6930f2a88638e4bb0
mfd: intel_quark_i2c_gpio: Don't play dirty trick with const

As Linus rightfully noticed, the driver plays dirty trick with const,
i.e. it assigns a place holder data structure to the const field
in the MFD cell and then drops the const by explicit casting. This is
not how it should be.

Assign local pointers of the cell and resource to the respective
non-const place holders in the intel_quark_i2c_setup() and
intel_quark_gpio_setup().

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/intel_quark_i2c_gpio.c