From patchwork Sun Feb 13 13:05:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 12744594 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 839ABC433F5 for ; Sun, 13 Feb 2022 13:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VIve+wpN418xizzMw8EuUCzzew2aHwHJk+eXIneBGlE=; b=uhPE+ZKzX+qx5+ 6jDHEJWPUP4b8nlw2iZGlfjcOMV4FBX+C22theNJnMGxGssEXyCS7LMEo+t1vPTYxGBH8qfwCGfmV jot46Bt8o1lD+tZHhm/TrorQBSOXWlntW3Xl9oNGyVqrLWdgK6VAl/1UacxKtEirpUaJO54SpxzV2 MbL0g8GHuZKbJCTegpCvUtSQD89bs2js0YU4bblbBzNVTrV3RDbIdpdVr0SZSDi+bHf5OhyiV1F7R gZ0NSPZwMf0PHNl102HXlXDQJWpHGzBXnteJaINdC/jf9sraetjWMxAmR9ub1H1Is9XP2IZvKeyiJ ejDSPuN7dv2v1bkwNN0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJEZa-00Bine-Vd; Sun, 13 Feb 2022 13:05:50 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJEZY-00BilH-Jg for linux-phy@lists.infradead.org; Sun, 13 Feb 2022 13:05:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644757547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0lIKP4e+Cty+i9AK+PrpEMunk31JuGZR+3dEheWS9AA=; b=TiQgNiCzqhPYEwx98u1y/8Afj6w7HA56G7Z9sq9pDmy1PLf48pLD555LkqffyqDML33RhP v7LFT8yIxB/+b6Jm8OfP3n0mbSvkkTxa/Kt942tZgMNWQzrO5NcQziDnq1iLbV2czE4wvq AXIlv+lHPESQQTXLSffe+h9vTa6vjl0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-172-nEOT2FljMY2o53ufDLoSnQ-1; Sun, 13 Feb 2022 08:05:40 -0500 X-MC-Unique: nEOT2FljMY2o53ufDLoSnQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1025F814245; Sun, 13 Feb 2022 13:05:39 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7965E7B9DD; Sun, 13 Feb 2022 13:05:37 +0000 (UTC) From: Hans de Goede To: Felipe Balbi , Greg Kroah-Hartman , Kishon Vijay Abraham I , Vinod Koul Cc: Hans de Goede , Stephan Gerhold , linux-usb@vger.kernel.org, linux-phy@lists.infradead.org Subject: [PATCH v2 3/9] usb: dwc3: pci: Set the swnode from inside dwc3_pci_quirks() Date: Sun, 13 Feb 2022 14:05:18 +0100 Message-Id: <20220213130524.18748-4-hdegoede@redhat.com> In-Reply-To: <20220213130524.18748-1-hdegoede@redhat.com> References: <20220213130524.18748-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220213_050548_742073_597D75A9 X-CRM114-Status: GOOD ( 12.81 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org The quirk handling may need to set some different properties which means using a different swnode, move the setting of the swnode to inside dwc3_pci_quirks() so that the quirk handling can choose a different swnode. Signed-off-by: Hans de Goede --- drivers/usb/dwc3/dwc3-pci.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 1ecedbb1684c..40a3a1b114e9 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -184,7 +184,8 @@ static const struct software_node dwc3_pci_amd_mr_swnode = { .properties = dwc3_pci_mr_properties, }; -static int dwc3_pci_quirks(struct dwc3_pci *dwc) +static int dwc3_pci_quirks(struct dwc3_pci *dwc, + const struct software_node *swnode) { struct pci_dev *pdev = dwc->pci; @@ -241,7 +242,7 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc) } } - return 0; + return device_add_software_node(&dwc->dwc3->dev, swnode); } #ifdef CONFIG_PM @@ -306,11 +307,7 @@ static int dwc3_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) dwc->dwc3->dev.parent = dev; ACPI_COMPANION_SET(&dwc->dwc3->dev, ACPI_COMPANION(dev)); - ret = device_add_software_node(&dwc->dwc3->dev, (void *)id->driver_data); - if (ret < 0) - goto err; - - ret = dwc3_pci_quirks(dwc); + ret = dwc3_pci_quirks(dwc, (void *)id->driver_data); if (ret) goto err;