Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3260351rwb; Mon, 15 Aug 2022 22:34:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4oCJ4AS1wXXKu1wnIHuvFnvAaKm8luEt8+oN8HccFzMnVcDMuveLtPvXRY+mEmWEqrujt3 X-Received: by 2002:a05:6402:27ca:b0:43e:ce64:ca07 with SMTP id c10-20020a05640227ca00b0043ece64ca07mr17970067ede.66.1660628086631; Mon, 15 Aug 2022 22:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628086; cv=none; d=google.com; s=arc-20160816; b=rlUJkZ4WXJl6oUjV4JUj7OSyeyujxlZCjJQmdd/dELGcVYDLjDIqxMcexf3YZ9B6Gq cKIbbtaJSUKgmXeCREIzarRLqTVZS0bw+0w+01bM+h7OwPI73lVLPsEdYsId1kq/xpsm XQb6gt1RGVLG4jwEGZX4LmAoD45zbpAEfPxeQTeq/sBPjGS21DsP58J91It/aJBn1y1G KAbQeuOLgBJZjbeuPD4Mnrs2KbjdWoZr00PkpaRUOZZKhNiZrZ/8TVzl84yfWcIk7l29 tjrjFwc2Vl0zILTygw/1rcBYsVURFwGct7SHcEoDLIL2CPncRahGDdi35mOH9t+Jpyb1 ccMQ== 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=IIN8wRImjDwR1NKhqTXL/MNUeNpjfw68mP49tg0JNk8=; b=R2th+m3/BkOaNIUnRZJFSsC1fM2k6F+hCOjEp/JpVEDaKMys6QkrVTTzQWGLIIerdc LR5G3LW0nLmPMYILhxw1PROdVDC6Mc/xWuc3fgdR7xbILZVyGK5G7X0GMXBXYDgnp2VT YNfeSP9xprbBIsTirDrZTAMyphyCL1OmK9546HVqK9BBwxNLghf2uHy7uy6z2mWu441u DKxWkZ5v0Y33sdfjrlrehjqpn8UrTGXtYmB2mr8MsYVMBHML+zUDx5x14PnZXCueSZ5d vZfu2883y37ehHcjCM9uEKUzzHUPXQipWMaqdOvt/qyye13rK4Krrp3Rvj8UWBo/VP7g 3JUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="XUVTv/iS"; 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 q28-20020a50c35c000000b0043cd18d34e1si8096987edb.177.2022.08.15.22.34.21; Mon, 15 Aug 2022 22:34:46 -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="XUVTv/iS"; 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 S231700AbiHPEmL (ORCPT + 99 others); Tue, 16 Aug 2022 00:42:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231434AbiHPEjv (ORCPT ); Tue, 16 Aug 2022 00:39:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26747A1D28; Mon, 15 Aug 2022 13:31:22 -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 ams.source.kernel.org (Postfix) with ESMTPS id AD5ACB80EA8; Mon, 15 Aug 2022 20:31:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA4A8C433D6; Mon, 15 Aug 2022 20:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595479; bh=yg6v+E6w4tYGmjS7g1TgMXBUqPL+Zz2rnmZLUdugTHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XUVTv/iSVcdfAwZQy0VpeAKBD3/ktXp+H58X++BqDLDPD7TcSnOV67wrdCZL+kUxN 9X49Tvw8WIPDVvoO5drSJn0nr3zzlZucqmd/scB3SomUDtF6ldVqgK0xk5fsljokOV 0Q5odalaiVb84DrGW+/HzJLoxZ4ZFElLjTwX0KDA= 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 5.19 0777/1157] soundwire: bus_type: fix remove and shutdown support Date: Mon, 15 Aug 2022 20:02:13 +0200 Message-Id: <20220815180510.569347444@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 893296f3fe39..b81e04dd3a9f 100644 --- a/drivers/soundwire/bus_type.c +++ b/drivers/soundwire/bus_type.c @@ -193,12 +193,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