From patchwork Sat May 20 17:44:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 100233 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp809678qge; Sat, 20 May 2017 10:46:47 -0700 (PDT) X-Received: by 10.98.22.9 with SMTP id 9mr16654312pfw.125.1495302407856; Sat, 20 May 2017 10:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495302407; cv=none; d=google.com; s=arc-20160816; b=F+Z11tBVL4a0HDnujqv9lJrbK5IjPHhw4QZm3kIAVyh2AVEoYtzc1hyi2WsQ8DiXDA IfjlsVR0sqRqAiqlW59vwhdJCYxx5XTnsF7gz2pNfnuFUfqCnhOEyVm8saVfd3lPqSDQ +rgvbnPiB3eBwqXrulitskJ8JE7UaPhTWjbNL6cLGV9Z7nrXkZ/3HD9YwMK6f4v3gVGF 2miuMScHAYbOs3o1xuSaZV1wPtsSz+53f6VnutJ7uzEvTSh8HPlcWttDmHRNIaaJBB3i +knZ+Vnj6UWaO7A2NmsLFe8S3wggddYScpiYgvMHcDJlwCG+daw9x8N2kp+babiMTxih bRIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=sB9Cppd/XMQVd/QknudcmIPOPywe8OhNRaphO3npGeM=; b=Wj9yS4KsG6JCZw0zi3CTM8yDcHEZMLFVkoic9LDNbP28W62X0xHRDVP2HcGrd8gwGB 0bsnuyyblye0d0OumZ/YWrP9lftSkho/OoLbsWHyGnU9E3b4CZxDdfQSt/F6VY05LfV3 P1RJSDrXesS+0ZwwLVhorKNyELLVlsA914FLLYr8GzgfdVfn50omqv2ysFrDyejmRc/Y wWiH5KteK64COnk88cxVa7hWzcSAFLUaJsyngtd85AeMJq1XC0xy1u4jkhZYdOdeoV0P o1du1fxdniFKMU4kQsL2ppHDg8q7E7EcOG2IQgDO7d+tmm5rVFbDB17H5pf+MahU9l+N kYiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si12092250pgf.56.2017.05.20.10.46.47; Sat, 20 May 2017 10:46:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755227AbdETRq2 (ORCPT + 25 others); Sat, 20 May 2017 13:46:28 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:34455 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754274AbdETRq0 (ORCPT ); Sat, 20 May 2017 13:46:26 -0400 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-07.nifty.com with ESMTP id v4KHiqd7024413; Sun, 21 May 2017 02:44:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v4KHiqd7024413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1495302299; bh=sB9Cppd/XMQVd/QknudcmIPOPywe8OhNRaphO3npGeM=; h=From:To:Cc:Subject:Date:From; b=MAu5sz4lgi/q1k7UsG233pGvv++kbUA8Yv4+PimQkf+Gexs7evTdpGGd3e1Ou4BWV SCnX3fSL3lvnV94k8jZfoHUdN9ikmKKgVuAtD6IdMQJbS3Np2kIKljfAANjnd5wP1W 2SlRq4xIguM46I2sODOgL+KWBhQ5hnIMM6S6qhD3nv/i66ms007wJbQKMjJv1/sudq Y0l5VMl5TKwSjPN3FXeQ3zY8QFnWOpI/rqcuJXBeWoIllAlfw4gKGbtO+S5wLm9DFQ 64003YiN8jjgxUZVChBOeEHfNXYZsNRVypbr1EGgxuqIOGm7WKUIVCx4r6+kQ+z4ml fwBF9GuH07M6A== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-serial@vger.kernel.org Cc: Masahiro Yamada , Arnd Bergmann , Robert Jarzmik , Sekhar Nori , Jiri Slaby , linux-kernel@vger.kernel.org, David Lechner , Thor Thayer , Greg Kroah-Hartman Subject: [PATCH] serial: of_serial: remove NULL pointer check for clk_disable_unprepare Date: Sun, 21 May 2017 02:44:46 +0900 Message-Id: <1495302286-1503-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After long term efforts of fixing non-common clock implementations, clk_disable() is a no-op for a NULL pointer input, and this is now tree-wide consistent. All clock consumers can safely call clk_disable(_unprepare) without NULL pointer check. Signed-off-by: Masahiro Yamada --- drivers/tty/serial/8250/8250_of.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 1cbadaf..89ba2b5 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -159,8 +159,8 @@ static int of_platform_serial_setup(struct platform_device *ofdev, return 0; out: - if (info->clk) - clk_disable_unprepare(info->clk); + clk_disable_unprepare(info->clk); + return ret; } @@ -229,8 +229,8 @@ static int of_platform_serial_remove(struct platform_device *ofdev) serial8250_unregister_port(info->line); - if (info->clk) - clk_disable_unprepare(info->clk); + clk_disable_unprepare(info->clk); + kfree(info); return 0; } @@ -244,7 +244,7 @@ static int of_serial_suspend(struct device *dev) serial8250_suspend_port(info->line); - if (info->clk && (!uart_console(port) || console_suspend_enabled)) + if (!uart_console(port) || console_suspend_enabled) clk_disable_unprepare(info->clk); return 0;