Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3404437rwa; Tue, 23 Aug 2022 04:20:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ji6Gf00EPNSNYqVFCV79rLa1bMmB0nz4pLwVI1iSktCOzVz2CBeEYJikKszkaP+518pr7 X-Received: by 2002:a17:902:7e45:b0:172:8c47:ff2e with SMTP id a5-20020a1709027e4500b001728c47ff2emr23543365pln.24.1661253613905; Tue, 23 Aug 2022 04:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253613; cv=none; d=google.com; s=arc-20160816; b=CkkmSep2DZsgtTABl8aVlHG6heJcE+VwnzD7b6p1Tb3E4y3wvRAXTqz61GXWsVfFoh IcdVwjh79JPq+gitKFsWB4vhvH5lGX6hHcPHoKfJclS8jb2uHf9wdHeSOlrX+t8v/Epn cscqK88L2SYN05Xq892Dn9ukHjitXfDRwy5fWtWlLS7ezRpPMYWu2ici5NY1FkRyGBi5 So+UGYNxBGuzRShsYxbC4ULf6kvsw9y0ZFfk3XuSuKVUHO0l+0kxjlh+M3inbgKdUNwP Mq1jcVVB1QyyPsgxQESL50w7wSkW1huOkWK7i8kLjCbZPxrUPLa9kdd/DG/UKDNMa1Qu hqHg== 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=3UGDyXRtXXm+qNd6r5lIJhnKRQlaU+0Cr7wOM5zlTws=; b=LsLoPtAp3qu1u7douzy26GCleY0jwdrVc3A/+hcBnS/iKitt5f2/37ulBhiMv1nfoh 1VGsvroM5kzpnvpsUO6IDdUtfuRTpKsI/14EBbtYxrHrAvMu3TvhhQkE/tYrOy9nxNJ8 ezee4VpiEZmhOOG6ZajHXWvDSgJyJQbP9m004LgI4qxz5WXjEW1C23leJzaa415jDuKI PqDjZgoNWpmoZ4Iprin0326dvXmaR8jVtK89lglo1koOV41XkWr1kO4qZhPcm7VlJYBu NH3kPRg1zsdfIYGHa2QnKPad28OppZ9g7T8KRWuVLPMljSEP7u5MghBiDaannt7ta2Ve X+3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pz3r1zVP; 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 b7-20020a170903228700b00172a92ab10csi15867913plh.524.2022.08.23.04.20.02; Tue, 23 Aug 2022 04:20:13 -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=pz3r1zVP; 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 S1356554AbiHWKmf (ORCPT + 99 others); Tue, 23 Aug 2022 06:42:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355012AbiHWKas (ORCPT ); Tue, 23 Aug 2022 06:30:48 -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 B78F685AAA; Tue, 23 Aug 2022 02:06:30 -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 DFCC761596; Tue, 23 Aug 2022 09:06:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA5A6C433B5; Tue, 23 Aug 2022 09:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245589; bh=GBN9yMYjGurun1AV7Y40ykMKxztoq6vHXN9KuxWaQRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pz3r1zVPgOEpZria0vYEOH3LlyJkmmJIR+jZl0NXdt+hr36FGaONV3qeMlhUzTQh7 u8DImZoPaa8ccL7C/5dQI1U/pd6JDrGbZ8rUFxQnTLRZB2VxQ70nRsgB6QAThfo9s3 iqRAbgFR8BboITl574qbQvUouV3v0FNWEseD3AjY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Louis Bossart , Rander Wang , Bard Liao , Vinod Koul , Sasha Levin Subject: [PATCH 4.19 125/287] soundwire: bus_type: fix remove and shutdown support Date: Tue, 23 Aug 2022 10:24:54 +0200 Message-Id: <20220823080104.601080377@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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: Pierre-Louis Bossart [ Upstream commit df6407782964dc7e35ad84230abb38f46314b245 ] The bus sdw_drv_remove() and sdw_drv_shutdown() helpers are used conditionally, if the driver provides these routines. These helpers already test if the driver provides a .remove or .shutdown callback, so there's no harm in invoking the sdw_drv_remove() and sdw_drv_shutdown() unconditionally. In addition, the current code is imbalanced with dev_pm_domain_attach() called from sdw_drv_probe(), but dev_pm_domain_detach() called from sdw_drv_remove() only if the driver provides a .remove callback. Fixes: 9251345dca24b ("soundwire: Add SoundWire bus type") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220610015105.25987-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/soundwire/bus_type.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c index 283b2832728e..414621f3c43c 100644 --- a/drivers/soundwire/bus_type.c +++ b/drivers/soundwire/bus_type.c @@ -154,12 +154,8 @@ int __sdw_register_driver(struct sdw_driver *drv, struct module *owner) drv->driver.owner = owner; drv->driver.probe = sdw_drv_probe; - - if (drv->remove) - drv->driver.remove = sdw_drv_remove; - - if (drv->shutdown) - drv->driver.shutdown = sdw_drv_shutdown; + drv->driver.remove = sdw_drv_remove; + drv->driver.shutdown = sdw_drv_shutdown; return driver_register(&drv->driver); } -- 2.35.1