i2c: rk3x: account for const type of of_device_id.data
authorJulia Lawall <Julia.Lawall@lip6.fr>
Tue, 2 Jan 2018 13:28:03 +0000 (14:28 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 17 Jan 2018 23:10:30 +0000 (00:10 +0100)
commitd032a2eb2e3b9fc2def41c22bfb58e1efc2c6823
tree3bfb564577a2d7206f3ddb20afbd60a4fbbd7746
parentf89813ec8ba4b46c7926325eb9835ef1c6793496
i2c: rk3x: account for const type of of_device_id.data

This driver creates a number of const structures that it stores in
the data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Furthermore, adding const to the declaration of the location that
receives a const value from such a field ensures that the compiler
will continue to check that the value is not modified.  The
const-discarding cast on the extraction from the data field is thus
no longer needed.

Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-rk3x.c