Skip to contentSkip to conversation

mfd : t7l66xb: remove unnecessary pdata check

PATCH Applied Maninder Singh 2 participants 2 messages Jul 2, 2015 – Jul 7, 2015 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mfd : t7l66xb: remove unnecessary pdata check

o Making pdata NULL check to (!pdata) as coding standard and all other checks in file.
o Removing redundant check of pdata, because we already check for pdata, and also derefernced before this check.

---
v2: changing subject line.

 drivers/mfd/t7l66xb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/t7l66xb.c +2 -2
index c09fb5d..854b05f 100644
@@ -318,7 +318,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 	struct resource *iomem, *rscr;
 	int ret;
 
-	if (pdata == NULL)
+	if (!pdata)
 		return -EINVAL;
 
 	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
@@ -371,7 +371,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 
 	clk_prepare_enable(t7l66xb->clk48m);
 
-	if (pdata && pdata->enable)
+	if (pdata->enable)
 		pdata->enable(dev);
 
 	/* Mask all interrupts */
Signature · 1 line
1.7.9.5
Applied
#1 lore raw
Quoted 11 lines · Maninder Singh

o Making pdata NULL check to (!pdata) as coding standard and all other checks in file.
o Removing redundant check of pdata, because we already check for pdata, and also derefernced before this check.

---
v2: changing subject line.

 drivers/mfd/t7l66xb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Quoted 22 lines
drivers/mfd/t7l66xb.c +2 -2
index c09fb5d..854b05f 100644
@@ -318,7 +318,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 	struct resource *iomem, *rscr;
 	int ret;
 
-	if (pdata == NULL)
+	if (!pdata)
 		return -EINVAL;
 
 	iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
@@ -371,7 +371,7 @@ static int t7l66xb_probe(struct platform_device *dev)
 
 	clk_prepare_enable(t7l66xb->clk48m);
 
-	if (pdata && pdata->enable)
+	if (pdata->enable)
 		pdata->enable(dev);
 
 	/* Mask all interrupts */
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog