Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9348431rwp; Thu, 20 Jul 2023 03:41:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlHloPjOh9v0pRY7DH4KhniBK+4LaKE1UpqvnMga1ohYNYv/z/TnE2Ve5gaFHNYfyuwpixzb X-Received: by 2002:aa7:d602:0:b0:51e:1c5c:b97f with SMTP id c2-20020aa7d602000000b0051e1c5cb97fmr5424575edr.2.1689849692373; Thu, 20 Jul 2023 03:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689849692; cv=none; d=google.com; s=arc-20160816; b=cO0MSaDqWLkjd+6HkWXaEiZ1+fvmbAvTmlG5Oeaf12X8BCmKKfs3QRDhKDuWoGqQLE BKlnvcUvLZH4E3Zl4yt9o8T59fzPk1Dm8xHmNItbNeGbwSEBNgdVAUtf8enUdMSPVSN1 qhlkGI1kGpxW+PK0kd4PKDGPGER7pxnOqMM2GIVxP45Hu8iGLA6CaFg4GlxHxHvYMw1P PNlhIsgXTue9w9KVGPh6rmepyDVQ56SJ4vZDpH4BGLcz1ZuWvHgwBNK/egfsmrHMN9D4 V/O6eTPHF/3dwFBppzlw/xXE7wnQ4eW0jkMPEBjb4JVVOlDmFmQSPFRwD0bHtezXV+pi R6hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject; bh=EQBvwDpIqLO4gTSyLAZ1DlMadkLQRpzbB90V15XD0pc=; fh=xAhM3jLWPwUcY3mkPPiCa7A6RWRtGx0TDKwKEZ0D628=; b=Eu/hQ1BTp7SCFBC/KwmwZRHsgDxJKgfq1XC80ydMCH0B19PyPPaNyTWaRykiIplCJE ghUjDZXK3z52u7lE9yo55Px0yn71PjQqZSLOZ0FtxDbOn1gjg8v4TOdZCtlRMUpDAOw/ DEwvauQN8tG6YdrNiKq6f0BahcvwhOaAXPKlPWdwNE4VwOcBgDQH5e9YTp3cc1v/Cu3m kolJyOeyRU+0OOO7/OZhLRq0ebpQ0jJHNrOya5RkMntVfB6S8HAXuDth/MyEZSFl1pyd ALC73xs98LfPfw8JKBtUL9eXBSvqywe+SErLdh15VeOoP2KkZOYYBZg54Xqrx9Kjsbyr DeZw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020a50ee82000000b0051a53f2684fsi583760edr.576.2023.07.20.03.41.07; Thu, 20 Jul 2023 03:41:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229758AbjGTJs3 (ORCPT + 99 others); Thu, 20 Jul 2023 05:48:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231273AbjGTJsC (ORCPT ); Thu, 20 Jul 2023 05:48:02 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A1252122; Thu, 20 Jul 2023 02:46:06 -0700 (PDT) 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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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 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