From patchwork Fri Jan 24 09:29:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 232948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B435C2D0DB for ; Fri, 24 Jan 2020 11:24:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F253D2077C for ; Fri, 24 Jan 2020 11:24:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865047; bh=133xA4VF1oQQJFYUCOcynO9vUt/JVJBclCo/934+ItE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ahUub/F9d9Bjf4PT7oOO6W+7rxXPPA3xDLd5Gnoa9AZB9sr+5kzYRW/NWg5dfOfI4 T4z7CQavsImtj1aQzoA41tMZ1GXwd7m7TVROp11cn9DirvsLU/A9dOJodpV8YtA32A 3cqv7W+cboiMd0072Ax1ymVemOPFo9kIIx8r60po= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390818AbgAXLYC (ORCPT ); Fri, 24 Jan 2020 06:24:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:36968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388606AbgAXLX6 (ORCPT ); Fri, 24 Jan 2020 06:23:58 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B8EDA206D4; Fri, 24 Jan 2020 11:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865037; bh=133xA4VF1oQQJFYUCOcynO9vUt/JVJBclCo/934+ItE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yxNrM9asotGkvmPbcqQAT+7QjXmT+wXG31h1iJkvZmbyw87JY4Vrdc9DRvi7DRiH+ P4JgQnUMWWRmZ2UCno692Kqwqe2YM18uwsqcD6+8ajvfF2Q+xZ2COV7EuLAoLZt0xM eNnU+ixr2q3siYEr5OtU8jjGrzkmVRII/ROwi5Ic= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Kishon Vijay Abraham I , Sasha Levin Subject: [PATCH 4.19 421/639] phy: usb: phy-brcm-usb: Remove sysfs attributes upon driver removal Date: Fri, 24 Jan 2020 10:29:51 +0100 Message-Id: <20200124093139.812496508@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Fainelli [ Upstream commit d9e100829fca6cbd270d7e005b0c0bb2d14924b8 ] We are not destroying the sysfs attribute groupe we registered during the probe function which will make subsequent probe calls to that driver fail. Correct that with adding a remove function which only removes those attributes since the reference counting on clocks did its job already. Fixes: 415060b21f31 ("phy: usb: phy-brcm-usb: Add ability to force DRD mode to host or device") Signed-off-by: Florian Fainelli Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Sasha Levin --- drivers/phy/broadcom/phy-brcm-usb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/phy/broadcom/phy-brcm-usb.c b/drivers/phy/broadcom/phy-brcm-usb.c index d1dab36fa5b7b..e2455ffb85979 100644 --- a/drivers/phy/broadcom/phy-brcm-usb.c +++ b/drivers/phy/broadcom/phy-brcm-usb.c @@ -378,6 +378,13 @@ static int brcm_usb_phy_probe(struct platform_device *pdev) return 0; } +static int brcm_usb_phy_remove(struct platform_device *pdev) +{ + sysfs_remove_group(&pdev->dev.kobj, &brcm_usb_phy_group); + + return 0; +} + #ifdef CONFIG_PM_SLEEP static int brcm_usb_phy_suspend(struct device *dev) { @@ -443,6 +450,7 @@ MODULE_DEVICE_TABLE(of, brcm_usb_dt_ids); static struct platform_driver brcm_usb_driver = { .probe = brcm_usb_phy_probe, + .remove = brcm_usb_phy_remove, .driver = { .name = "brcmstb-usb-phy", .owner = THIS_MODULE,