From patchwork Fri Aug 21 17:31:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7052861 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 6D425C05AD for ; Fri, 21 Aug 2015 17:40:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3555F20451 for ; Fri, 21 Aug 2015 17:40:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5471F2045A for ; Fri, 21 Aug 2015 17:40:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752121AbbHURkU (ORCPT ); Fri, 21 Aug 2015 13:40:20 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:33960 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751963AbbHURkS (ORCPT ); Fri, 21 Aug 2015 13:40:18 -0400 Received: by wicne3 with SMTP id ne3so25624671wic.1; Fri, 21 Aug 2015 10:40:16 -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=Cl5mIHpLYaS3useCP8EAIwjXo5GKe5u9XcoVFFNp6tU=; b=EJzWuqbTpBq9T94SxG+wSbma+zIQRfjsFj+Ucx/MF3wU7ug6Gf1tgCV3/ZCQQwIV4V W1W1v+hWQuSuKHZ2TXdsziI5bpwgnOU6Z8/qhfjA4vHq/sSePVcGEMQy4KP89/+UidaQ tWsKdNzbRMywhNY+vhmnS9ivK4/5sd359wrV0YcHNNA5FiOYqrUsQB07BXj0b789s3g/ euBpI5vOsC9WS8kGsTtiHcrCtVPfIoZOMRRYBxE2fPL7Y0by+QwAQ0588mdCPyt+I+Gl UKiBs/GAvfQeOe6YCX2/6wOh5YI8tL92j7cPPdscXxWAkk+2UH/92RByJeJWVOF4PD3k D2KA== X-Received: by 10.180.82.7 with SMTP id e7mr7422806wiy.19.1440178816213; Fri, 21 Aug 2015 10:40:16 -0700 (PDT) Received: from ?IPv6:2003:62:5f33:d300:4526:b663:4b92:a3e2? (p200300625F33D3004526B6634B92A3E2.dip0.t-ipconnect.de. [2003:62:5f33:d300:4526:b663:4b92:a3e2]) by smtp.googlemail.com with ESMTPSA id kb1sm10881113wjc.24.2015.08.21.10.40.15 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Aug 2015 10:40:15 -0700 (PDT) Message-ID: <55D7607E.8050808@gmail.com> Date: Fri, 21 Aug 2015 19:31:42 +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 v2] 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.6 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 v2: - Added "Reviewed-by" 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: