]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/input/touchscreen/sun4i-ts.c
Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_register
[mirror_ubuntu-bionic-kernel.git] / drivers / input / touchscreen / sun4i-ts.c
index d2e14d9e59753288168d50de4d8e2e880ed40ce3..ab44eb0352d060e7f7953924b069dd20fad6144f 100644 (file)
@@ -246,6 +246,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct device_node *np = dev->of_node;
        struct device *hwmon;
+       struct thermal_zone_device *thermal;
        int error;
        u32 reg;
        bool ts_attached;
@@ -365,7 +366,10 @@ static int sun4i_ts_probe(struct platform_device *pdev)
        if (IS_ERR(hwmon))
                return PTR_ERR(hwmon);
 
-       devm_thermal_zone_of_sensor_register(ts->dev, 0, ts, &sun4i_ts_tz_ops);
+       thermal = devm_thermal_zone_of_sensor_register(ts->dev, 0, ts,
+                                                      &sun4i_ts_tz_ops);
+       if (IS_ERR(thermal))
+               return PTR_ERR(thermal);
 
        writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC);