diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2017-05-18 17:11:40 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2017-06-02 16:52:51 -0400 |
commit | 90b84c057414cbcca53337c64afc348541989d7d (patch) | |
tree | 27cc21b1fbe30f69fa3c1681e3e66e6cceada85b | |
parent | d2f31c49cf7cfe8f02b70614ae56a39b0c1d8a75 (diff) |
i2c: sh_mobile: drop needless check for of_node
After removal of platform_data support, we can simplify OF handling.
of_match_device() evaluates to NULL if !CONFIG_OF or if there is no node
pointer for that device, so we can remove the check for the node ptr.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r-- | drivers/i2c/busses/i2c-sh_mobile.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index d5e39eccae9b..2e097d97d258 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c | |||
@@ -881,6 +881,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) | |||
881 | struct sh_mobile_i2c_data *pd; | 881 | struct sh_mobile_i2c_data *pd; |
882 | struct i2c_adapter *adap; | 882 | struct i2c_adapter *adap; |
883 | struct resource *res; | 883 | struct resource *res; |
884 | const struct of_device_id *match; | ||
884 | int ret; | 885 | int ret; |
885 | u32 bus_speed; | 886 | u32 bus_speed; |
886 | 887 | ||
@@ -910,22 +911,16 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) | |||
910 | 911 | ||
911 | ret = of_property_read_u32(dev->dev.of_node, "clock-frequency", &bus_speed); | 912 | ret = of_property_read_u32(dev->dev.of_node, "clock-frequency", &bus_speed); |
912 | pd->bus_speed = ret ? STANDARD_MODE : bus_speed; | 913 | pd->bus_speed = ret ? STANDARD_MODE : bus_speed; |
913 | |||
914 | pd->clks_per_count = 1; | 914 | pd->clks_per_count = 1; |
915 | 915 | ||
916 | if (dev->dev.of_node) { | 916 | match = of_match_device(sh_mobile_i2c_dt_ids, &dev->dev); |
917 | const struct of_device_id *match; | 917 | if (match) { |
918 | 918 | const struct sh_mobile_dt_config *config = match->data; | |
919 | match = of_match_device(sh_mobile_i2c_dt_ids, &dev->dev); | ||
920 | if (match) { | ||
921 | const struct sh_mobile_dt_config *config; | ||
922 | 919 | ||
923 | config = match->data; | 920 | pd->clks_per_count = config->clks_per_count; |
924 | pd->clks_per_count = config->clks_per_count; | ||
925 | 921 | ||
926 | if (config->setup) | 922 | if (config->setup) |
927 | config->setup(pd); | 923 | config->setup(pd); |
928 | } | ||
929 | } | 924 | } |
930 | 925 | ||
931 | /* The IIC blocks on SH-Mobile ARM processors | 926 | /* The IIC blocks on SH-Mobile ARM processors |