]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i2c: sh_mobile: Use of_device_get_match_data() helper
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 4 Oct 2017 12:17:05 +0000 (14:17 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 17 Oct 2017 21:58:11 +0000 (23:58 +0200)
Use the of_device_get_match_data() helper instead of open coding.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-sh_mobile.c

index 6f2aaeb7c4fa156dd79274794d1985f40db504a6..c03acdf7139726779982b190d4d26cff047d48c9 100644 (file)
@@ -881,7 +881,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
        struct sh_mobile_i2c_data *pd;
        struct i2c_adapter *adap;
        struct resource *res;
-       const struct of_device_id *match;
+       const struct sh_mobile_dt_config *config;
        int ret;
        u32 bus_speed;
 
@@ -913,10 +913,8 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
        pd->bus_speed = ret ? STANDARD_MODE : bus_speed;
        pd->clks_per_count = 1;
 
-       match = of_match_device(sh_mobile_i2c_dt_ids, &dev->dev);
-       if (match) {
-               const struct sh_mobile_dt_config *config = match->data;
-
+       config = of_device_get_match_data(&dev->dev);
+       if (config) {
                pd->clks_per_count = config->clks_per_count;
 
                if (config->setup)