From patchwork Thu Aug 20 20:02:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7046911 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AA864C05AC for ; Thu, 20 Aug 2015 20:13:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 634BB20456 for ; Thu, 20 Aug 2015 20:13:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 901ED20453 for ; Thu, 20 Aug 2015 20:13:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752151AbbHTUNl (ORCPT ); Thu, 20 Aug 2015 16:13:41 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:35498 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752107AbbHTUNl (ORCPT ); Thu, 20 Aug 2015 16:13:41 -0400 Received: by wicne3 with SMTP id ne3so155151210wic.0; Thu, 20 Aug 2015 13:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=4YTVGsxXsUlkK1DoAv2kRCwCReWZekrcfT1kZufq1/0=; b=m6vqmiE4jykTQ81Lhl8F1zYjVoI13kbjlwhgBpFTH+sZVExZ8DMWsVfyORKqFAe0dk byf9uBjhIXPySfnwIlOSbtbtepGKXmm6pocBRhx3GCiOzDNKeC6XXZu/noXC8ati3kJ+ kzwsaBak9sRifcIxS2SWGdRgHXtYmr93qn1YruWlfpLVfBB9pTfDCsIolHxwQrVj/ZJx 2Zj7ZNiWtcT8CTXfc++tnmhsNROixdzqR5Nzn2+lS5wbUZEVdav6A/g1PLNxjyRobSjO fOrkatQ+opT4IwL6JYi7X91TBXyXqnvfJibBh0b3GI6QUYA3F69uHX2Nt3Lc2DoRE0EV cQfQ== X-Received: by 10.180.188.49 with SMTP id fx17mr88153wic.74.1440101619797; Thu, 20 Aug 2015 13:13:39 -0700 (PDT) Received: from ?IPv6:2003:62:5f33:d300:fd69:4033:8d2f:d215? (p200300625F33D300FD6940338D2FD215.dip0.t-ipconnect.de. [2003:62:5f33:d300:fd69:4033:8d2f:d215]) by smtp.googlemail.com with ESMTPSA id z11sm31988052wij.9.2015.08.20.13.13.39 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Aug 2015 13:13:39 -0700 (PDT) Message-ID: <55D6324F.7070601@gmail.com> Date: Thu, 20 Aug 2015 22:02:23 +0200 From: Heiner Kallweit User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Krzysztof Kozlowski CC: linux-samsung-soc@vger.kernel.org, "linux-spi@vger.kernel.org" Subject: [PATCH 1/4 RESEND] spi: s3c64xx: clean up runtime PM if driver registration fails Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix missing runtime PM cleanup if driver registration fails. Signed-off-by: Heiner Kallweit Reviewed-by: Krzysztof Kozlowski --- Changed: - Separated fix from added functionality drivers/spi/spi-s3c64xx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index cd1cfac..8a6ab88 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1186,7 +1186,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) ret = devm_spi_register_master(&pdev->dev, master); if (ret != 0) { dev_err(&pdev->dev, "cannot register SPI master: %d\n", ret); - goto err3; + goto err4; } dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n", @@ -1197,6 +1197,9 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) return 0; +err4: + pm_runtime_disable(&pdev->dev); + pm_runtime_set_suspended(&pdev->dev); err3: clk_disable_unprepare(sdd->src_clk); err2: