i2c: meson: Fix wrong speed use from probe
authorLucas Tanure <tanure@linux.com>
Tue, 1 Mar 2022 07:26:00 +0000 (07:26 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:42 +0000 (14:23 +0200)
commit9b2bbf36b9cff18c4469c0f016b023adc27904d8
tree36915c05c31f1d7fab2e25adc3546799d25b90b7
parent7409ff6393a67ff9838d0ae1bd102fb5f020d07a
i2c: meson: Fix wrong speed use from probe

[ Upstream commit cb13aa16f34f794a9cee2626862af8a95f0f0ee9 ]

Having meson_i2c_set_clk_div after i2c_add_adapter
causes issues for client drivers that try to use
the bus before the requested speed is applied.

The bus can be used just after i2c_add_adapter, so
move i2c_add_adapter to the final step as
meson_i2c_set_clk_div needs to be called before
the bus is used.

Fixes: 09af1c2fa490 ("i2c: meson: set clock divider in probe instead of setting it for each transfer")
Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-meson.c