MLK-10055-2: mfd: si476x-i2c: sound is registered when no FM module attached
authorShengjiu Wang <shengjiu.wang@freescale.com>
Wed, 24 Dec 2014 08:51:22 +0000 (16:51 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:14 +0000 (14:48 -0500)
The si476x_core_get_revision_info will send i2c command to FM module, if it
return error, there is no FM modules attached, so we need't to register the
sound card. otherwise, the pulseaudio will access this sound card, but return
a lot of i2c error.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 4c8e9916128f05f9b4115e1ee1af4a1e7d800c4a)

drivers/mfd/si476x-i2c.c

index 5013a98..3caa239 100644 (file)
@@ -811,15 +811,14 @@ static int si476x_core_probe(struct i2c_client *client,
        core->power_state = SI476X_POWER_UP_FULL;
        si476x_core_set_power_state(core, SI476X_POWER_DOWN);
 
+       rval = si476x_core_get_revision_info(core);
+       if (rval < 0) {
+               rval = -ENODEV;
+               goto free_kfifo;
+       }
+
        if (of_property_read_bool(client->dev.of_node, "revision-a10"))
                core->revision = SI476X_REVISION_A10;
-       else {
-               rval = si476x_core_get_revision_info(core);
-               if (rval < 0) {
-                       rval = -ENODEV;
-                       goto free_kfifo;
-               }
-       }
 
        cell_num = 0;