[PATCH v2 4/4] max8903: remove unnecessary malloc failed message print out.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




From: Chris Lapa <chris@xxxxxxxxxxx>

Signed-off-by: Chris Lapa <chris@xxxxxxxxxxx>
---
 drivers/power/max8903_charger.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/power/max8903_charger.c b/drivers/power/max8903_charger.c
index 20d4b55..d60f9b2 100644
--- a/drivers/power/max8903_charger.c
+++ b/drivers/power/max8903_charger.c
@@ -246,10 +246,8 @@ static int max8903_probe(struct platform_device *pdev)
 	int usb_in = 0;
 
 	charger = devm_kzalloc(dev, sizeof(struct max8903_data), GFP_KERNEL);
-	if (charger == NULL) {
-		dev_err(dev, "Cannot allocate memory.\n");
+	if (!charger)
 		return -ENOMEM;
-	}
 
 	charger->pdata = pdev->dev.platform_data;
 	if (IS_ENABLED(CONFIG_OF) && !charger->pdata && dev->of_node) {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux