Skip to content

Commit a49d9ba

Browse files
krzklag-linaro
authored andcommitted
mfd: arizona: 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 7b28133 commit a49d9ba

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/mfd/arizona-spi.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,12 @@ static int arizona_spi_acpi_probe(struct arizona *arizona)
190190

191191
static int arizona_spi_probe(struct spi_device *spi)
192192
{
193-
const struct spi_device_id *id = spi_get_device_id(spi);
194-
const void *match_data;
195193
struct arizona *arizona;
196194
const struct regmap_config *regmap_config = NULL;
197195
unsigned long type = 0;
198196
int ret;
199197

200-
match_data = device_get_match_data(&spi->dev);
201-
if (match_data)
202-
type = (unsigned long)match_data;
203-
else if (id)
204-
type = id->driver_data;
205-
198+
type = (unsigned long)spi_get_device_match_data(spi);
206199
switch (type) {
207200
case WM5102:
208201
if (IS_ENABLED(CONFIG_MFD_WM5102))

0 commit comments

Comments
 (0)