diff mbox

pinctrl: samsung: Remove an always false dev->of_node test

Message ID 1472731140-18034-1-git-send-email-s.nawrocki@samsung.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

samsung_pinctrl_probe() can be called only after matching
the driver by the compatible string so this already implies
a non null dev->of_node.  Remove the always false test
and related error trace. While at it drop another error log
in case of memory allocation failure - any errors are logged
by the memory subsystem.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/pinctrl/samsung/pinctrl-samsung.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Comments

Krzysztof Kozlowski Sept. 1, 2016, 12:09 p.m. UTC | #1
On 09/01/2016 01:59 PM, Sylwester Nawrocki wrote:
> samsung_pinctrl_probe() can be called only after matching
> the driver by the compatible string so this already implies
> a non null dev->of_node.  Remove the always false test
> and related error trace. While at it drop another error log
> in case of memory allocation failure - any errors are logged
> by the memory subsystem.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
>  drivers/pinctrl/samsung/pinctrl-samsung.c | 10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof


--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Sept. 7, 2016, 8:11 p.m. UTC | #2
On Thu, Sep 1, 2016 at 1:59 PM, Sylwester Nawrocki
<s.nawrocki@samsung.com> wrote:

> samsung_pinctrl_probe() can be called only after matching
> the driver by the compatible string so this already implies
> a non null dev->of_node.  Remove the always false test
> and related error trace. While at it drop another error log
> in case of memory allocation failure - any errors are logged
> by the memory subsystem.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Patch applied with Krzysztof's review tag.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index 513fe6b..620727f 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -1041,17 +1041,9 @@  static int samsung_pinctrl_probe(struct platform_device *pdev)
 	struct resource *res;
 	int ret;
 
-	if (!dev->of_node) {
-		dev_err(dev, "device tree node not found\n");
-		return -ENODEV;
-	}
-
 	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
-	if (!drvdata) {
-		dev_err(dev, "failed to allocate memory for driver's "
-				"private data\n");
+	if (!drvdata)
 		return -ENOMEM;
-	}
 
 	ctrl = samsung_pinctrl_get_soc_data(drvdata, pdev);
 	if (IS_ERR(ctrl)) {