OSDN Git Service

i2c: i2c-designware-platdrv: Cleanup setting of the adapter number
authorHans de Goede <hdegoede@redhat.com>
Tue, 12 Mar 2019 14:55:53 +0000 (15:55 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 13 Mar 2019 17:06:56 +0000 (18:06 +0100)
commit77f3381a83c2f66daeb6719a1191a87280d57f62
tree232df842bd2ce7cf4f2d78fd7bd80735b5959b79
parentbf263c35b2ebe7f1674205f6b36487250299b5a7
i2c: i2c-designware-platdrv: Cleanup setting of the adapter number

i2c-designware-platdrv assumes that if the pdev has an apci-companion
it should use a dynamic adapter-nr and otherwise it will use pdev->id
as adapter-nr.

Before this commit the setting of the adapter.nr was somewhat convoluted,
in the acpi_companion case it was set from dw_i2c_acpi_configure, in the
non acpi_companion case it was set from dw_i2c_set_fifo_size based on
tx_fifo_depth not being set yet indicating that dw_i2c_acpi_configure was
not executed.

This cleans this up, directly setting the adapter-nr from
dw_i2c_plat_probe for both cases.

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>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-designware-platdrv.c