]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb24943e1cd4dfc7f25be7ece1739cb13b6fa63d9
treec4583da616a538864434e66bbf1780ef11e94575
parent66b8c98ee4e5a5d9f00d06431328fe260b3f0425
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