Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3178243imw; Mon, 11 Jul 2022 03:39:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vxvcBKvFBxmVAgDebYpduJfCIOOavwQcJO51HEas+vs4Iy8SYivf1F4cYNf1QqvyXdxGEW X-Received: by 2002:a05:6402:5306:b0:437:8bbd:b313 with SMTP id eo6-20020a056402530600b004378bbdb313mr23733505edb.123.1657535947801; Mon, 11 Jul 2022 03:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657535947; cv=none; d=google.com; s=arc-20160816; b=if3dmOs7Af/ZSIOzUnn9gEuiXT2bLL9ZGF5JDiyVeYOpkYR381amqiIeB48iWToCw+ hjLLLL/RjhH09+NhGSX1OIAo3RsG4aP6vdnFT8MhEZzGcURKuu5RW4Rbp35VfnIZ9dpC fKqvSJbklpXtNG8+DNS5BqqwKoVeQ6NipecU2F+RW64bNQ0trFVQxIEYs4/oHVlC9RXD WIEehnnFQBby5mAPSoTRqdsxRjjqx5OifvS8VH6GndYpljHSJSJTWYJGOcKPvPzDmOBG qb8WAi6KJHJLH0aOi4jaHH6bqVvmhZmQpYtDGVPFka1DOKSAdvKpLnZEfUY9XyKQLV4/ ua+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NL/eppjyL7OsYrAPry+SplvvyCk+iz5o54PMYkcaMYM=; b=yfzPbKt6BHEh3Ya4WqvYSVT7duEnJd2usbRQvdHFvwunYrTdcwhO7OPMLxCHkrVzux HxRqvoz+UTFtmUH8Nc53J+Wg9xX3ckOVRTGq49VRsxWkl+F588F94hmg7/99QiF/ynUf TMne1jV5cSGLTPThWXBTcBSpG02Ulnz/uf8mbLhZGMYMafrg89bUBNErUR2+EjCSQZas xUQxUe4l4WKFL5xRCikv5ZAoBtnJN2HDL0CfXGwa2wg8XL0EeOg4hFOxpveeDivBJ2VX C2S6eZcDk83ugKu8FLpCCHEliQy2GH0N3yt0z5Jaan88bp35+RGUr3tRmJiWY6pi1cwW 3yJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=slQXpu8i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o21-20020a17090611d500b00726c9f6cba6si8026593eja.743.2022.07.11.03.38.43; Mon, 11 Jul 2022 03:39:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=slQXpu8i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231497AbiGKJOP (ORCPT + 99 others); Mon, 11 Jul 2022 05:14:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230464AbiGKJNf (ORCPT ); Mon, 11 Jul 2022 05:13:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0293F237F3; Mon, 11 Jul 2022 02:09:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 96D22611CC; Mon, 11 Jul 2022 09:09:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3DD7C34115; Mon, 11 Jul 2022 09:09:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657530589; bh=l1Q1wtRwJmFlZezHCLT3SPsTHdqpZxHXhxJwB0kAIlo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=slQXpu8i0xf2FPUe4f4mHOOGZ6o30L9OBUrWjo6PE1C3AtyemzdmvU1bdqhvTL/Lf 2/oBrmJHrOl7z2UKmch7PrRgmlGVEpsTmErwDWGEYV3G6nUitJyH2yjlTeJQHqjD8C W16zP9yNrfz6j4XRIA+kaqhx7DoW75yfyAIZYfFE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Satish Nagireddy , Lars-Peter Clausen , Michal Simek , Wolfram Sang , Sasha Levin Subject: [PATCH 4.19 23/31] i2c: cadence: Unregister the clk notifier in error path Date: Mon, 11 Jul 2022 11:07:02 +0200 Message-Id: <20220711090538.532287250@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220711090537.841305347@linuxfoundation.org> References: <20220711090537.841305347@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Satish Nagireddy [ Upstream commit 3501f0c663063513ad604fb1b3f06af637d3396d ] This patch ensures that the clock notifier is unregistered when driver probe is returning error. Fixes: df8eb5691c48 ("i2c: Add driver for Cadence I2C controller") Signed-off-by: Satish Nagireddy Tested-by: Lars-Peter Clausen Reviewed-by: Michal Simek Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-cadence.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c index 2150afdcc083..273f57e277b3 100644 --- a/drivers/i2c/busses/i2c-cadence.c +++ b/drivers/i2c/busses/i2c-cadence.c @@ -990,6 +990,7 @@ static int cdns_i2c_probe(struct platform_device *pdev) return 0; err_clk_dis: + clk_notifier_unregister(id->clk, &id->clk_rate_change_nb); clk_disable_unprepare(id->clk); pm_runtime_set_suspended(&pdev->dev); pm_runtime_disable(&pdev->dev); -- 2.35.1