i2c: designware-baytrail: Only check iosf_mbi_available() for shared hosts
authorHans de Goede <hdegoede@redhat.com>
Fri, 10 Feb 2017 10:27:55 +0000 (11:27 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 2 Mar 2017 14:46:32 +0000 (15:46 +0100)
If (!shared_host) simply return 0, this avoids delaying the probe if
iosf_mbi_available() returns false when an i2c bus is not using the
punit semaphore.

Also move the if (!iosf_mbi_available()) check to above the
dev_info, so that we do not repeat the dev_info on every probe
until iosf_mbi_available() returns true.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170210102802.20898-6-hdegoede@redhat.com
drivers/i2c/busses/i2c-designware-baytrail.c

index a3f581cb1fbac0095de4d670b4afbed9197d7f87..cf022226b69347a2ce5607b3341f0098af5a26f1 100644 (file)
@@ -138,15 +138,16 @@ int i2c_dw_eval_lock_support(struct dw_i2c_dev *dev)
        if (ACPI_FAILURE(status))
                return 0;
 
-       if (shared_host) {
-               dev_info(dev->dev, "I2C bus managed by PUNIT\n");
-               dev->acquire_lock = baytrail_i2c_acquire;
-               dev->release_lock = baytrail_i2c_release;
-               dev->pm_runtime_disabled = true;
-       }
+       if (!shared_host)
+               return 0;
 
        if (!iosf_mbi_available())
                return -EPROBE_DEFER;
 
+       dev_info(dev->dev, "I2C bus managed by PUNIT\n");
+       dev->acquire_lock = baytrail_i2c_acquire;
+       dev->release_lock = baytrail_i2c_release;
+       dev->pm_runtime_disabled = true;
+
        return 0;
 }