Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp966246rwd; Tue, 13 Jun 2023 02:58:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6E5SKnQITAaDo0wnpAj27zRs2NcB2jL3xUEBAch6ax5qUweHFaUFrW8s3K03a1IY/p2TG0 X-Received: by 2002:a05:6a21:6713:b0:101:1951:d491 with SMTP id wh19-20020a056a21671300b001011951d491mr8989270pzb.6.1686650314185; Tue, 13 Jun 2023 02:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686650314; cv=none; d=google.com; s=arc-20160816; b=FVFnnMMe0994JR+7I8K6T1EjmM1Eyc5zWYziszBFLMoQJTb8TNS9vLyjbqviihKMGA 2SgkhoUooFA+j/p/bVc4dN8/dd3BTVgG1vBnmr2b14WZYDkPJR+Wl2T2G+0TmFO5lGp1 FAeLJs4GkR2+Y4EMX10op2+YBHjEqEiU71b8SDZmiXmnGIcJZFfyGTlyGeL9K+2MEPhc dNOYom/7Ko8vjO1rue9UFVbzZCjXksbf6Azb7hsLk1yVr9y6RiM/sJxf66NgNb7bCDxb T8OvfnvskP6uDVccM2hVFwaGcCxdYr0fOUa9S7YIEyM8fRN2f9IGsYoSoJMI6nWAcbo4 i2Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hhKnhKZ4s9GqWYXGkZxFvGu3vgNA8L61Y7zmwmhPsUI=; b=ok34I0gJ/YasMVS8hVdgg2A6yeOiaoopr7Dt9srKycw2leqFQN8B4ZUzqoq05tDpFc CYkE7tPvK/W7Gjjtvax30LLfnODj1m8kmVDEtttfhV7hnvPfpJ6Kn+zuscpd8oAzVlXp LnZktznNiWXup9AoQIx+9F6iCWeHp1YtnKKRbsU/U0+dWe51LMxvd6WklVIdMQPFcaaS lP8tDwuyOSLOCxKVFhGKcfaWmBJtOCkKJS02iyXs6PrLc13zWEdKEJH063GSVDC/MBZt oMG+S8Rcs4fiB1U69ZgWuSLPSlmeFp0oRQwCbS0NzRFoW77Gg68HE6c8H3ZBl/EdvoTy LKjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b="S4aJU6/a"; 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=QUARANTINE sp=NONE dis=NONE) header.from=baikalelectronics.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a170902c94a00b001b07739657fsi8863783pla.569.2023.06.13.02.58.22; Tue, 13 Jun 2023 02:58:34 -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=@baikalelectronics.ru header.s=post header.b="S4aJU6/a"; 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=QUARANTINE sp=NONE dis=NONE) header.from=baikalelectronics.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239821AbjFMJwd (ORCPT + 99 others); Tue, 13 Jun 2023 05:52:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234891AbjFMJwb (ORCPT ); Tue, 13 Jun 2023 05:52:31 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D5EE90; Tue, 13 Jun 2023 02:52:29 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id A383EE0DEC; Tue, 13 Jun 2023 12:52:28 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-type:content-type:date :from:from:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=post; bh=hhKnhKZ4s9GqWYXGkZxF vGu3vgNA8L61Y7zmwmhPsUI=; b=S4aJU6/a/aTHLy6v6l4lI8OaIXtZRgVyn9ym jjUYeqvz+jlIcFcHTplVua7yiobrcQCIBhpU1HDrKCfMwpZ78m1Ov6eF4g4nw7D7 Kpa8IEChTI9kXUeV4VEp3AQCy4LKsfksQnPz/avdR9EUhVRS6W2sSJJXXQziO1hb twVopO4= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 7EFFFE0DE4; Tue, 13 Jun 2023 12:52:28 +0300 (MSK) Received: from mobilestation (10.8.30.34) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 13 Jun 2023 12:52:27 +0300 Date: Tue, 13 Jun 2023 12:52:27 +0300 From: Serge Semin To: Andy Shevchenko CC: Damien Le Moal , Greg Kroah-Hartman , , , , Hans de Goede , Jens Axboe , "Rafael J. Wysocki" , Len Brown , Daniel Scally , Heikki Krogerus , Sakari Ailus Subject: Re: [PATCH v2 3/3] ata: ahci_platform: Make code agnostic to OF/ACPI Message-ID: <20230613095227.fr5j7i7mcdfmyxse@mobilestation> References: <20230609154900.43024-1-andriy.shevchenko@linux.intel.com> <20230609154900.43024-4-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230609154900.43024-4-andriy.shevchenko@linux.intel.com> X-Originating-IP: [10.8.30.34] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Fri, Jun 09, 2023 at 06:49:00PM +0300, Andy Shevchenko wrote: > With the help of a new device_is_compatible() make > the driver code agnostic to the OF/ACPI. This makes > it neater. As a side effect the header inclusions is > corrected (seems mod_devicetable.h was implicitly > included). I don't think the driver will get to be fully agnostic after this patch because for instance the ahci_platform_get_resources() method directly uses the OF-available functions, walks over the OF subnodes, touches the OF-properties, etc. So AFAICS in order to be fully OF/ACPI agnostic the entire libahci_platform.o driver needs to be converted too, but it's not trivial at all. Anyway as a start this patch looks good. Reviewed-by: Serge Semin -Serge(y) > > Signed-off-by: Andy Shevchenko > --- > drivers/ata/ahci_platform.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c > index ab30c7138d73..81fc63f6b008 100644 > --- a/drivers/ata/ahci_platform.c > +++ b/drivers/ata/ahci_platform.c > @@ -9,14 +9,14 @@ > */ > > #include > +#include > #include > #include > #include > -#include > #include > +#include > #include > #include > -#include > #include > #include "ahci.h" > > @@ -56,10 +56,10 @@ static int ahci_probe(struct platform_device *pdev) > if (rc) > return rc; > > - if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci")) > + if (device_is_compatible(dev, "hisilicon,hisi-ahci")) > hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ; > > - port = acpi_device_get_match_data(dev); > + port = device_get_match_data(dev); > if (!port) > port = &ahci_port_info; > > -- > 2.40.0.1.gaa8946217a0b > >