From patchwork Mon Mar 7 08:16:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaoqian Lin X-Patchwork-Id: 12771353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 053CDC433F5 for ; Mon, 7 Mar 2022 08:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EvrqCkX3khOW/RrshOG/tQQZC09Fa7CBsmV8hoz3qLM=; b=U19BmVQ55wP9vc RAG+Pb/lVmuAY5V3n9g2lVYNQtlfiI70ONWTdsm6yTWqiZQg7xa0JrNYge4SJqf7Mn2wyD+VeFJn7 vGDmlbnkAoxyzhyi95fDmPKAM0mOKagU41WmLlEhwCKwTZ9Yfnxkkcn1GJm/I8zpChvG8pT/4DnvQ rLgVzujPdFjw4SbMjuJgYa9INr5f4J6fShWnS782sKUU0+hp3DRmWPiZ5YB9W/POwIwiHlaoCddOe AUmMHT1WgBcyLVGKAe1EXRRjq+TpDievbU1EwKjLDO7QN7qvpDtQHWqR7xGWwzkDhZLHLexBZY+US 9N2KegFBf7/UNuCG0e6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Y0-00GRIO-BS; Mon, 07 Mar 2022 08:16:53 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Xs-00GRGx-4p for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 08:16:45 +0000 Received: by mail-pg1-x52e.google.com with SMTP id bc27so12947522pgb.4 for ; Mon, 07 Mar 2022 00:16:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=raqbpMEGShYefmM2lPsX/wn04IxIjWx9nKhMvQ9D+wE=; b=BNimnkt4tAYxOrYU5Uge9V4+0vLNsbclTuwKqjK74jpop5Qdyv69MW4oq/V22hs16i 1M9kbbvMzrCC1ddQzjInFS9ZKPkERkLR9l36a0vDcLUHHxP18YHx/aiKA2UGgEVo7D/1 1IQc1+Mq2DA8Pi4YRwDwW7I5NIm3A2snsdnOJ+A5MrZP0FP7cF5N898enWfJYa9Mxr5h OlTSo3RdkixkDw0H6pST7VYMAg7Ot50fRjhLFNwVHSjJp3DwAEtKX+NNasm67QhoVwUw 6QuuzqyDseOHjUgIw9Ina7WocvpZNZoY90Ql4eW6PQhx/crSrbM7jhd0gPcvWDEFdPHF RqYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=raqbpMEGShYefmM2lPsX/wn04IxIjWx9nKhMvQ9D+wE=; b=SLxC/jVp5V2i/yn4zzQ0wkfmueqMjjilJfDBvOWDIXtylV6nRh1wSwFqnEHcizetD3 LZNywbAW4/LzPbhdmmwIxFGzttq+b3iUdl/f57ERQZTBM9ON5UPDLdphR8QfN4dupav7 76Hz2z7h+Zn8WrOlyWYqnEG/bFXTzddU4IaG9yVOr0R+4fR4XZCJP+LLXMWbVPM4mGKn EoSvb6hUbIXDUx76Svrktgsa6IefztuUq7FbF2I5ssWvlCSU15LjK62uHQYBc13yxT7i HFJUP/pY9XWXGFxIk66Sk8qL4ecNwdCF+JGvtfwiRhPC1fPnpSRbETaIocKvRfPEqZVM t2sw== X-Gm-Message-State: AOAM530wifPg0+q6FQXubrRW9SsMlOAnwVV5y+MP+uXZ0nWvLPejC+1/ QnXbi/+/R7PjxwLsFQtE8ZQ= X-Google-Smtp-Source: ABdhPJwLCC8qpXc15DQQZT4xlr+B37oV+EAKeb375Bz04voz9973VRvzvRyVGd+65lNjSpUCJ17Zzw== X-Received: by 2002:a63:20f:0:b0:378:9f08:a0a4 with SMTP id 15-20020a63020f000000b003789f08a0a4mr8871175pgc.17.1646641003345; Mon, 07 Mar 2022 00:16:43 -0800 (PST) Received: from localhost.localdomain ([159.226.95.43]) by smtp.googlemail.com with ESMTPSA id x6-20020a17090aa38600b001bce781ce03sm11995365pjp.18.2022.03.07.00.16.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:16:43 -0800 (PST) From: Miaoqian Lin To: Eugen Hristev , Mauro Carvalho Chehab , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Hans Verkuil , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linmq006@gmail.com Subject: [PATCH v3] media: atmel: atmel-isc: Fix PM disable depth imbalance in atmel_isc_probe Date: Mon, 7 Mar 2022 08:16:37 +0000 Message-Id: <20220307081638.19733-1-linmq006@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <8e4a35a4-1d8f-5aff-f577-2a2b87646528@xs4all.nl> References: <8e4a35a4-1d8f-5aff-f577-2a2b87646528@xs4all.nl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_001644_244152_EC591F66 X-CRM114-Status: GOOD ( 15.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The pm_runtime_enable will decrease power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Fixes: 0a0e265 ("media: atmel: atmel-isc: split driver into driver base and isc") Signed-off-by: Miaoqian Lin Reviewed-by: Eugen Hristev --- changes in v2: - remove unused label. changes in v3: - add disable_pm label and update related 'goto' - update commit message --- drivers/media/platform/atmel/atmel-sama5d2-isc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c index 1b2063cce0f7..949035cdb846 100644 --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c @@ -538,7 +538,7 @@ static int atmel_isc_probe(struct platform_device *pdev) ret = clk_prepare_enable(isc->ispck); if (ret) { dev_err(dev, "failed to enable ispck: %d\n", ret); - goto cleanup_subdev; + goto disable_pm; } /* ispck should be greater or equal to hclock */ @@ -556,6 +556,9 @@ static int atmel_isc_probe(struct platform_device *pdev) unprepare_clk: clk_disable_unprepare(isc->ispck); +disable_pm: + pm_runtime_disable(dev); + cleanup_subdev: isc_subdev_cleanup(isc);