]> www.infradead.org Git - users/jedix/linux-maple.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>
Fri, 26 Mar 2021 14:52:11 +0000 (14:52 +0000)
commit43e72121b5f667b10ba5adae96880e388dda55d1
treec180d28f39a183334e2e294bb996562d3d8740ac
parent56b8234e3c5f1fb24d61b2a56c9cb59e048d8f82
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