i2c: bcm2835: Ensure clock exists when probing
authorAnnaliese McDermond <nh6z@nh6z.net>
Fri, 21 Jun 2019 10:52:50 +0000 (03:52 -0700)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 26 Jun 2019 13:14:48 +0000 (15:14 +0200)
commit9de93b04df16b055824e3f1f13fedb90fbcf2e4f
tree0073e4ab7912f21095a221e69ca48bcc7c1e9c50
parent4a5cfa39465cad25dd736d7ceba8a5d32eea4ecc
i2c: bcm2835: Ensure clock exists when probing

Probe function fails to recognize that upstream clock actually
doesn't yet exist because clock driver has not been initialized.
Actually try to go get the clock and test for its existence
before trying to set up a downstream clock based upon it.

This fixes a bug that causes the i2c driver not to work with
monolithic kernels.

Fixes: bebff81fb8b9 ("i2c: bcm2835: Model Divider in CCF")
Signed-off-by: Annaliese McDermond <nh6z@nh6z.net>
Acked-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-bcm2835.c