]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/thermal/ti-soc-thermal/ti-bandgap.c
Merge branch 'ufs-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / drivers / thermal / ti-soc-thermal / ti-bandgap.c
index ba9c302454fb398490046be46831c0a0f821788c..696ab3046b87d98cff65182f60499c98578175bd 100644 (file)
@@ -1010,7 +1010,7 @@ ti_bandgap_force_single_read(struct ti_bandgap *bgp, int id)
 }
 
 /**
- * ti_bandgap_set_continous_mode() - One time enabling of continuous mode
+ * ti_bandgap_set_continuous_mode() - One time enabling of continuous mode
  * @bgp: pointer to struct ti_bandgap
  *
  * Call this function only if HAS(MODE_CONFIG) is set. As this driver may
@@ -1214,22 +1214,18 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev)
        }
 
        bgp = devm_kzalloc(&pdev->dev, sizeof(*bgp), GFP_KERNEL);
-       if (!bgp) {
-               dev_err(&pdev->dev, "Unable to allocate mem for driver ref\n");
+       if (!bgp)
                return ERR_PTR(-ENOMEM);
-       }
 
        of_id = of_match_device(of_ti_bandgap_match, &pdev->dev);
        if (of_id)
                bgp->conf = of_id->data;
 
        /* register shadow for context save and restore */
-       bgp->regval = devm_kzalloc(&pdev->dev, sizeof(*bgp->regval) *
-                                  bgp->conf->sensor_count, GFP_KERNEL);
-       if (!bgp->regval) {
-               dev_err(&pdev->dev, "Unable to allocate mem for driver ref\n");
+       bgp->regval = devm_kcalloc(&pdev->dev, bgp->conf->sensor_count,
+                                  sizeof(*bgp->regval), GFP_KERNEL);
+       if (!bgp->regval)
                return ERR_PTR(-ENOMEM);
-       }
 
        i = 0;
        do {