aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2014-03-10 07:12:10 -0400
committerWolfram Sang <wsa@the-dreams.de>2014-03-28 03:47:32 -0400
commitf2a67d0c27c5c018ed592116f1e1577aa041d73d (patch)
tree592f4efa91414350bba2f2452a46836e48872ed9 /drivers/i2c
parentff370257ed0bba6e98a9538fefa402a4696f9857 (diff)
i2c: mv64xxx: Fix reset controller handling
The reset framework recently gained optional stubs when CONFIG_RESET_CONTROLLER is not selected. It also introduced a function reset_get_optional, that is also dummy-defined whenever the framework isn't enabled, for drivers that needs an optional reset controller. Switch to this function, since the mv64xxx driver is in this case. This also fixes a compilation breakage whenever the reset framework wasn't selected: drivers/i2c/busses/i2c-mv64xxx.c:771:2: error: implicit declaration of function 'devm_reset_control_get' While we're at it, remove the redundant test on dev.of_node surrounding the calls to reset framework functions, since it will either be a valid pointer, an error pointer in the case where we called reset_get_optional without an of_node pointer or if it failed, or NULL if we're not loaded through DT. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index eb76491a301e..681ea4db39a3 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -757,7 +757,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
757 } 757 }
758 drv_data->irq = irq_of_parse_and_map(np, 0); 758 drv_data->irq = irq_of_parse_and_map(np, 0);
759 759
760 drv_data->rstc = devm_reset_control_get(dev, NULL); 760 drv_data->rstc = devm_reset_control_get_optional(dev, NULL);
761 if (IS_ERR(drv_data->rstc)) { 761 if (IS_ERR(drv_data->rstc)) {
762 if (PTR_ERR(drv_data->rstc) == -EPROBE_DEFER) { 762 if (PTR_ERR(drv_data->rstc) == -EPROBE_DEFER) {
763 rc = -EPROBE_DEFER; 763 rc = -EPROBE_DEFER;
@@ -889,7 +889,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
889exit_free_irq: 889exit_free_irq:
890 free_irq(drv_data->irq, drv_data); 890 free_irq(drv_data->irq, drv_data);
891exit_reset: 891exit_reset:
892 if (pd->dev.of_node && !IS_ERR(drv_data->rstc)) 892 if (!IS_ERR_OR_NULL(drv_data->rstc))
893 reset_control_assert(drv_data->rstc); 893 reset_control_assert(drv_data->rstc);
894exit_clk: 894exit_clk:
895#if defined(CONFIG_HAVE_CLK) 895#if defined(CONFIG_HAVE_CLK)
@@ -909,7 +909,7 @@ mv64xxx_i2c_remove(struct platform_device *dev)
909 909
910 i2c_del_adapter(&drv_data->adapter); 910 i2c_del_adapter(&drv_data->adapter);
911 free_irq(drv_data->irq, drv_data); 911 free_irq(drv_data->irq, drv_data);
912 if (dev->dev.of_node && !IS_ERR(drv_data->rstc)) 912 if (!IS_ERR_OR_NULL(drv_data->rstc))
913 reset_control_assert(drv_data->rstc); 913 reset_control_assert(drv_data->rstc);
914#if defined(CONFIG_HAVE_CLK) 914#if defined(CONFIG_HAVE_CLK)
915 /* Not all platforms have a clk */ 915 /* Not all platforms have a clk */