Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2877780rwb; Mon, 15 Aug 2022 13:08:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR4UQUsuRwcFwAolQAFyOW12Ldiamzki6HJ1gQBq1zyNgmQ4tuftPTaC3CnyGI1eUm4IrqjO X-Received: by 2002:a17:907:da4:b0:733:f44:c96d with SMTP id go36-20020a1709070da400b007330f44c96dmr11339117ejc.546.1660594124831; Mon, 15 Aug 2022 13:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594124; cv=none; d=google.com; s=arc-20160816; b=ID/gNu94PBfl9USrBkgXaEZyUSJEcXRb9Q4oqT2MAVRATnGDiu1Fes251J0s7byoRb Uk0WlFiZwq3J8tyJfIIwaeiXiMkEcDP9/vC+Juna076NbnFA/u9nK6IOEQ/aok+ZbURg jmqrHoPJF3mqIvAkcxrO84sEYOlmSZMFTAaGBaMvyFBKU9ViG6p8dpPo/DMRTfwah2lS X/Mfiou6/WrHbScfOeJrNf1Hj1UGqTPdjIXPwUKwPhpAbrjMFy39t7PRcPvzPt1BymFn r3l34KMs7xEwYTN/5fGCXhe9upFbH00/3RkBLl8bHG5IfY8w+cacJZCv1oq8qJMzfue4 V0xw== 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=EG6x1r6aARltkSay2tstpkf64phgXh96/27e+sOFAqN8Qbsl/wlmJJHvRuYvfIbpo4 ufMfZPbCcO3iAW4sXko6kg42H2LqPuwLHTiD/Nhb0xTDUPIWp/GJ13a8aohK1q7Gi8Zc Gu2A2sBffZVgh8m7II4bxUmXd+4QlsrAoSD8G2TLj3ieS7lido4O/RIcikx5XmlLGUQx v58EyA+CIIpv4lTAHyCLLrlCy/xgdXcJYB5eBD/xMMLw3cLExp2D2sKIoFv6CxuvCm9L EOMX7/08JBymjlDwYK65N07d1V8TZyZVEWuQQR+fs4VV7hCmgc2AmMsL2x6UHFnJSO3A ZtdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nXgjMYpJ; 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 ds10-20020a170907724a00b00726347cbb61si8650555ejc.981.2022.08.15.13.08.18; Mon, 15 Aug 2022 13:08:44 -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=nXgjMYpJ; 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 S1343869AbiHOTOr (ORCPT + 99 others); Mon, 15 Aug 2022 15:14:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344084AbiHOTLl (ORCPT ); Mon, 15 Aug 2022 15:11:41 -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 A82AE5004C; Mon, 15 Aug 2022 11:37:10 -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 CE821610A4; Mon, 15 Aug 2022 18:37:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD37EC433C1; Mon, 15 Aug 2022 18:37:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588629; bh=yg6v+E6w4tYGmjS7g1TgMXBUqPL+Zz2rnmZLUdugTHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nXgjMYpJscj2GnOr8+zjsjOpu31nCSQyVF4q/jFNbxbxiQJPFW9WnDHIt+pWUCTkS C+X1woBd5nQtHohzPeS9Dfb4l2BCkd8BWIFp3/kyCd3hcXvrKK9cQSD5Sy8DQc6XBY 2pfJTN/Em5JyM4auErsgGMUwWiESmuY4iVDEoiUA= 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.15 465/779] soundwire: bus_type: fix remove and shutdown support Date: Mon, 15 Aug 2022 20:01:49 +0200 Message-Id: <20220815180357.179148072@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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