Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1857661rwb; Fri, 19 Aug 2022 10:32:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR4zNaZVUZ1/mdDk1evrSnhleVHpPEj/sSN+ki8RX0VCSQOlRi1vzLHxrJ9ashdR48skM6Ds X-Received: by 2002:a17:902:a613:b0:172:a073:6d38 with SMTP id u19-20020a170902a61300b00172a0736d38mr8287197plq.133.1660930340937; Fri, 19 Aug 2022 10:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930340; cv=none; d=google.com; s=arc-20160816; b=PsIS1sO6GgTE2PH7dH2sDXjjpxDX2x2Ofhy8c5EsNK3Sa0idSHLpAUBM1CgLqzTukN jzrO9Rg4vLgs/gkHM8bc77b3pWoid14khGA27QEBfxtJPksukyARx+xiRhXOciqeNl9n ZcPgX+304fcDNpy7NkbWmWCn2qM84tj1GrbIZ13bpKcDsKamFzRJ8alm/Z5+Ue02pDCy tYfge/e74lbSI2aNtXFnPvfWr0mYZ16gAUaU6mNBgoSsV0sw+3oz7vonnrgZ4KvevoCO P+faSzpn1fBuYUjjtmr1zWWYqTod3j4yFLSzrDdf96ETb6o/EDv7L36/2D605dfnTyuW 2Cow== 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=FGdahT0Q509SzgpZCwu2MgE6wT6SK8FRipnUFxVMTGI=; b=gacyzt2OY9y6M0dTG3Gg0lfMyG8Zo6QfJr/9ROXXw8+BBmQ3O5Zo4Jw4DGLE32RkLN kgad1/rb8oGd/fQwFkMGQDXdSoTWPMq4doPXspTDZ45V9/rAzg0YdJA1GWJAkBRqgTNg Ocdsz52Jf1OB7e7lTUWxdLEsY6BcZNDX1UlfH2fneCFombfuPKsfZ1QSN/UpIxHsfLC2 Gmdp9AYSlVonoPVLC7FdtITFAqal1jzQ7EVnriz79MWvWYGgps5km1N6Y1Hqj0arCKEl AfBVjCSY67lZzrm+eRhipUNYCBn7gthmGS3Epr9iJ3h/vfV2hprBtFzaaqFrmMg2aFLx gv8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hx1umKUr; 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 t20-20020a170902e1d400b0017283063df2si3901536pla.334.2022.08.19.10.32.10; Fri, 19 Aug 2022 10:32:20 -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=Hx1umKUr; 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 S1352506AbiHSQXI (ORCPT + 99 others); Fri, 19 Aug 2022 12:23:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352829AbiHSQRw (ORCPT ); Fri, 19 Aug 2022 12:17:52 -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 ACB1E109A0A; Fri, 19 Aug 2022 09:01:04 -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 03F82B82812; Fri, 19 Aug 2022 16:00:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66C2CC433C1; Fri, 19 Aug 2022 16:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924855; bh=mFpks+6CJE9JybU0qYCKr1moepg052c0NDycVc86EZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hx1umKUrEmPXg7zwgdpYqB2G2u/ob9yitdxSc6Eat372qam0PnbevW7VjwXb5YmoK f+iiGbY4mQIhGn/V7YpUepWfd4XT48G5cFN6h7Fv75uurGvaDa0MulMH53ukBkJdB+ QjtR0KV1ZBESF5BQSmgSK6Q2UUAEWowXfX2ybvcs= 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.10 304/545] soundwire: bus_type: fix remove and shutdown support Date: Fri, 19 Aug 2022 17:41:14 +0200 Message-Id: <20220819153842.945524699@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 575b9bad99d5..2e8986cccdd4 100644 --- a/drivers/soundwire/bus_type.c +++ b/drivers/soundwire/bus_type.c @@ -184,12 +184,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