From mboxrd@z Thu Jan 1 00:00:00 1970 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 853CEEB64DC for ; Fri, 21 Jul 2023 08:57:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 859DFE8F; Fri, 21 Jul 2023 10:56:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 859DFE8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1689929818; bh=XVecn2lUrs7lVoynuoh7e1nM0qfFUB5y8w/Ra7kHBAU=; h=Subject:To:CC:References:From:Date:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DENld+vtZ2cEyFiFirJ0x0ZcPQT3a7EABAMEI7ScaC/y9ZPuU0lyXuA6AmLoKlFC/ eAgNyHMX8ZLSBq9/ZZSZNisMC26+i9Zdy371RuqFlbmB5B5kVbtNU0tPqKo49UUeA7 wlTdX3TXA0mXrJ1bCKupX0b57D14+Z9+0pTaSPjQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4EDD8F805EB; Fri, 21 Jul 2023 10:53:52 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 5EBDDF805E7; Fri, 21 Jul 2023 10:53:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3C22FF8047D; Thu, 20 Jul 2023 11:46:10 +0200 (CEST) Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 68DFBF8027B for ; Thu, 20 Jul 2023 11:46:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 68DFBF8027B Received: from [192.168.1.103] (178.176.74.113) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.14; Thu, 20 Jul 2023 12:45:57 +0300 Subject: Re: [PATCH v3 26/42] ata: pata_ep93xx: add device tree support To: , Hartley Sweeten , Lennert Buytenhek , Alexander Sverdlin , Russell King , Lukasz Majewski , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , Daniel Lezcano , Thomas Gleixner , Alessandro Zummo , Alexandre Belloni , Wim Van Sebroeck , Guenter Roeck , Sebastian Reichel , Thierry Reding , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Mark Brown , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Dmitry Torokhov , Arnd Bergmann , Olof Johansson , , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Andy Shevchenko , Michael Peters , Kris Bahnsen CC: , , , , , , , , , , , , , , , References: <20230605-ep93xx-v3-0-3d63a5f1103e@maquefel.me> <20230605-ep93xx-v3-26-3d63a5f1103e@maquefel.me> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: Date: Thu, 20 Jul 2023 12:45:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20230605-ep93xx-v3-26-3d63a5f1103e@maquefel.me> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [178.176.74.113] X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.59, Database issued on: 07/20/2023 09:27:01 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 178742 [Jul 20 2023] X-KSE-AntiSpam-Info: Version: 5.9.59.0 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 524 524 9753033d6953787301affc41bead8ed49c47b39d X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: {relay has no DNS name} X-KSE-AntiSpam-Info: {SMTP from is not routable} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.74.113 in (user) b.barracudacentral.org} X-KSE-AntiSpam-Info: d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;omp.ru:7.1.1;178.176.74.113:7.7.3,7.4.1,7.1.2 X-KSE-AntiSpam-Info: {iprep_blacklist} X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.74.113 X-KSE-AntiSpam-Info: {DNS response errors} X-KSE-AntiSpam-Info: Rate: 59 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 07/20/2023 09:32:00 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 7/20/2023 4:32:00 AM X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-MailFrom: s.shtylyov@omp.ru X-Mailman-Rule-Hits: max-recipients X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-size; news-moderation; no-subject; digests; suspicious-header Message-ID-Hash: 2PZ2GXPUO2SZUHJOXPUGOXV742C5ZTUF X-Message-ID-Hash: 2PZ2GXPUO2SZUHJOXPUGOXV742C5ZTUF X-Mailman-Approved-At: Fri, 21 Jul 2023 08:53:21 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 7/20/23 2:29 PM, Nikita Shubin via B4 Relay wrote: > From: Nikita Shubin > > - Add OF ID match table > - Drop ep93xx_chip_revision and use soc_device_match instead > > Signed-off-by: Nikita Shubin > --- > drivers/ata/pata_ep93xx.c | 26 ++++++++++++++++++++------ > 1 file changed, 20 insertions(+), 6 deletions(-) > > diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c > index c6e043e05d43..a88824dfc5fa 100644 > --- a/drivers/ata/pata_ep93xx.c > +++ b/drivers/ata/pata_ep93xx.c [...] > @@ -910,6 +912,12 @@ static struct ata_port_operations ep93xx_pata_port_ops = { > .port_start = ep93xx_pata_port_start, > }; > > +static const struct soc_device_attribute ep93xx_soc_table[] = { > + { .revision = "E1", .data = (void *)ATA_UDMA3 }, > + { .revision = "E2", .data = (void *)ATA_UDMA4 }, > + { /* sentinel */ } > +}; > + > static int ep93xx_pata_probe(struct platform_device *pdev) > { > struct ep93xx_pata_data *drv_data; > @@ -939,7 +947,7 @@ static int ep93xx_pata_probe(struct platform_device *pdev) > > drv_data = devm_kzalloc(&pdev->dev, sizeof(*drv_data), GFP_KERNEL); > if (!drv_data) { > - err = -ENXIO; > + err = -ENOMEM; > goto err_rel_gpio; > } > Hm, deserves its own patch. And even for this one, you should've documented it in the patch secription... > @@ -976,12 +984,11 @@ static int ep93xx_pata_probe(struct platform_device *pdev) > * so this driver supports only UDMA modes. > */ > if (drv_data->dma_rx_channel && drv_data->dma_tx_channel) { > - int chip_rev = ep93xx_chip_revision(); > + const struct soc_device_attribute *match; > > - if (chip_rev == EP93XX_CHIP_REV_E1) > - ap->udma_mask = ATA_UDMA3; > - else if (chip_rev == EP93XX_CHIP_REV_E2) > - ap->udma_mask = ATA_UDMA4; > + match = soc_device_match(ep93xx_soc_table); > + if (match) > + ap->udma_mask = (unsigned int) match->data; > else > ap->udma_mask = ATA_UDMA2; > } This one also looks as it could have been done separately -- before the DT conversion? [...] MBR, Sergey