Skip to content

Commit 0ddabc8

Browse files
krzklag-linaro
authored andcommitted
mfd: madera: Simplify with spi_get_device_match_data()
Use spi_get_device_match_data() helper to simplify a bit the driver. Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent a49d9ba commit 0ddabc8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/mfd/madera-spi.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,14 @@
1818

1919
static int madera_spi_probe(struct spi_device *spi)
2020
{
21-
const struct spi_device_id *id = spi_get_device_id(spi);
2221
struct madera *madera;
2322
const struct regmap_config *regmap_16bit_config = NULL;
2423
const struct regmap_config *regmap_32bit_config = NULL;
25-
const void *of_data;
2624
unsigned long type;
2725
const char *name;
2826
int ret;
2927

30-
of_data = of_device_get_match_data(&spi->dev);
31-
if (of_data)
32-
type = (unsigned long)of_data;
33-
else
34-
type = id->driver_data;
35-
28+
type = (unsigned long)spi_get_device_match_data(spi);
3629
switch (type) {
3730
case CS47L15:
3831
if (IS_ENABLED(CONFIG_MFD_CS47L15)) {

0 commit comments

Comments
 (0)