MLK-21478-1 usb: typec: tcpci: use correct driver data
authorLi Jun <jun.li@nxp.com>
Wed, 17 Apr 2019 04:31:06 +0000 (12:31 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Thu, 18 Apr 2019 00:00:38 +0000 (03:00 +0300)
As the driver data is tcpci_chip in new kernel, so correct this.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
drivers/usb/typec/tcpci.c

index 655aa78..7d999ad 100644 (file)
@@ -785,8 +785,6 @@ static int tcpci_probe(struct i2c_client *client,
        if (!chip)
                return -ENOMEM;
 
-       chip->tcpci->client = client;
-
        chip->data.regmap = devm_regmap_init_i2c(client, &tcpci_regmap_config);
        if (IS_ERR(chip->data.regmap))
                return PTR_ERR(chip->data.regmap);
@@ -797,6 +795,8 @@ static int tcpci_probe(struct i2c_client *client,
        if (IS_ERR(chip->tcpci))
                return PTR_ERR(chip->tcpci);
 
+       chip->tcpci->client = client;
+
        err = tcpci_ss_mux_control_init(chip->tcpci);
        if (err)
                goto err1;
@@ -827,20 +827,20 @@ static int tcpci_remove(struct i2c_client *client)
 
 static int tcpci_suspend(struct device *dev)
 {
-       struct tcpci *tcpci = dev_get_drvdata(dev);
+       struct tcpci_chip *chip = dev_get_drvdata(dev);
 
        if (device_may_wakeup(dev))
-               enable_irq_wake(tcpci->client->irq);
+               enable_irq_wake(chip->tcpci->client->irq);
 
        return 0;
 }
 
 static int tcpci_resume(struct device *dev)
 {
-       struct tcpci *tcpci = dev_get_drvdata(dev);
+       struct tcpci_chip *chip = dev_get_drvdata(dev);
 
        if (device_may_wakeup(dev))
-               disable_irq_wake(tcpci->client->irq);
+               disable_irq_wake(chip->tcpci->client->irq);
 
        return 0;
 }