Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751004AbbERDXu (ORCPT ); Sun, 17 May 2015 23:23:50 -0400 Received: from conssluserg002.nifty.com ([202.248.44.40]:57956 "EHLO conssluserg002-v.nifty.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750711AbbERDXm (ORCPT ); Sun, 17 May 2015 23:23:42 -0400 X-Nifty-SrcIP: [74.125.82.52] MIME-Version: 1.0 In-Reply-To: References: <1431692764-17576-1-git-send-email-yamada.masahiro@socionext.com> Date: Mon, 18 May 2015 12:23:29 +0900 Message-ID: Subject: Re: [PATCH] serial: 8250_uniphier: add UniPhier serial driver From: Masahiro Yamada To: Joachim Eastwood Cc: Peter Hurley , Alan Cox , Greg Kroah-Hartman , Sebastian Andrzej Siewior , "linux-kernel@vger.kernel.org" , linux-serial@vger.kernel.org, Matthias Brugger , Ricardo Ribalda Delgado , Andy Shevchenko , Jiri Slaby , "linux-arm-kernel@lists.infradead.org" , John Crispin Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2226 Lines: 90 Hi Joachim, 2015-05-16 7:28 GMT+09:00 Joachim Eastwood : >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include > > Please put the includes in alphabetic order. OK. > Do you really need init.h? Not really. Will remove it. >> +static int uniphier_of_serial_setup(struct platform_device *pdev, >> + struct uart_port *port, >> + struct uniphier8250_priv *priv) >> +{ >> + int ret; >> + u32 prop; >> + struct device_node *np = pdev->dev.of_node; >> + >> + ret = of_alias_get_id(np, "serial"); >> + if (ret < 0) { >> + dev_err(&pdev->dev, "failed to get alias id\n"); >> + return ret; >> + } >> + port->line = priv->line = ret; >> + >> + /* Get clk rate through clk driver */ >> + priv->clk = of_clk_get(np, 0); >> + if (IS_ERR(priv->clk)) { >> + dev_err(&pdev->dev, "failed to get clock\n"); >> + return PTR_ERR(priv->clk); >> + } > > Use devm_clk_get() if possible. Sure. > >> +static int uniphier_uart_remove(struct platform_device *pdev) >> +{ >> + struct uniphier8250_priv *priv = platform_get_drvdata(pdev); >> + >> + serial8250_unregister_port(priv->line); >> + if (!IS_ERR_OR_NULL(priv->clk)) { >> + clk_disable_unprepare(priv->clk); >> + clk_put(priv->clk); >> + } > > If you use devm_clk_get() in uniphier_of_serial_setup() you only need > to call clk_disable_unprepare() here. > > Calling clk_disable_unprepare() with NULL is allowed and you already > check for IS_ERR in your setup function. Yes. Thank you for your review! -- Best Regards Masahiro Yamada -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/