Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3389337rwb; Tue, 8 Nov 2022 04:08:07 -0800 (PST) X-Google-Smtp-Source: AMsMyM7jaKAFei21pUpy9Y+HnrsAKR0QStB3AZCMd3hq5toiq6uy7AFsbpaJh4Cfrj0Lqg4BpP2G X-Received: by 2002:a17:90b:1bca:b0:213:c9ce:dad4 with SMTP id oa10-20020a17090b1bca00b00213c9cedad4mr52089577pjb.205.1667909287159; Tue, 08 Nov 2022 04:08:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667909287; cv=none; d=google.com; s=arc-20160816; b=W2WoUrOVm/U7mmROfjshOF03R3VgiZJrG7ZOVudgqHfNg+SysQ8SEhaPvzJnJ8ohB2 W4aDX8Jq45RFij1BcKhzexqvlFBt3D8wTq+w3+RCRUEIA8jJDUsDy/0tDZk/9KlEmEN/ 7qB3+ZAqKwHoNOUjZCrWIM80AKTzUDi+tvZe4GlAtQGSNX88Yq++BBDdwpVXmhuM4e6N NaWGqFncfpRiD1wjXlBNRr8UKgCzzX7MzvooS49Ldk06oVbU7ZvsS+zdWAiwvJccbb1E f2vqQbXtGII3mAe5+kDNGeISM8eK9ZJ12L9qnJDwsAugxDptVy0MSUkj2OdpemEdnwTK ezgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=pKSKbDab9Yk3touAk055rHd3dLlG++9ZmC8xudS4rd4=; b=eJ4WuOqh4ZVfW0lfgs25XeC0bg185V1OZT/fqJAvtufV4ZA6d58SRkxE6/AHZUGH0n QSHuQ4BhgxT8rH2N2DMsgcGxn6+aQEn0vh7xAFWaZQN1CG/VZcqsf8oQhrrL6FBGCkbt Ua2gfESJMbI66tNHoOXWq4voITMtRWg10cb0NlwOpa2VZ8NJC92MBXiw9l4PfSLYcXT6 r0CGgakWaKen6mpEgKSsTzB+vfjPCiFS6HwN/QImjVpkxqTFEYs7nSuE1E5hGK6SIbYt d/zvyDsNvAsymmU1Q9QcwfoY8YW8EHifFRVB5nbBMxECH7DxKc+7S4LSCcLfYuj6mtVn lU1w== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp10-20020a17090b4a8a00b002138cf12af8si27844934pjb.1.2022.11.08.04.07.54; Tue, 08 Nov 2022 04:08:07 -0800 (PST) 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233779AbiKHLRi (ORCPT + 90 others); Tue, 8 Nov 2022 06:17:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbiKHLRh (ORCPT ); Tue, 8 Nov 2022 06:17:37 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D29B917E1F; Tue, 8 Nov 2022 03:17:35 -0800 (PST) Received: from canpemm500004.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N65D55WTLzRp4y; Tue, 8 Nov 2022 19:17:25 +0800 (CST) Received: from [10.174.179.106] (10.174.179.106) by canpemm500004.china.huawei.com (7.192.104.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 8 Nov 2022 19:17:32 +0800 Subject: Re: [PATCH next 1/2] gpio: hisi: Add initial device tree support To: Linus Walleij , Andy Shevchenko CC: , , , , , , , , References: <20221026034219.172880-1-chenweilong@huawei.com> From: chenweilong Message-ID: <33794563-ae4b-87e5-09df-d800268828f8@huawei.com> Date: Tue, 8 Nov 2022 19:17:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.174.179.106] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500004.china.huawei.com (7.192.104.92) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 2022/11/8 18:33, Linus Walleij wrote: > Hi Weilong, > > thanks for your patch! > > On Wed, Oct 26, 2022 at 5:34 AM Weilong Chen wrote: > >> Add support for HiSilicon GPIO controller in embedded platform, which >> boot from devicetree. >> >> Signed-off-by: Weilong Chen > I will provide OF comments, I let Andy and other ACPI experts say > what is necessary for ACPI. > > (...) >> +#include > I don't know if this is necessary, check it. > >> #include >> #include >> #include >> +#include > This is unnecessary for what you are trying to do. Drop it. > >> +#ifdef CONFIG_ACPI >> static const struct acpi_device_id hisi_gpio_acpi_match[] = { >> {"HISI0184", 0}, >> {} >> }; >> MODULE_DEVICE_TABLE(acpi, hisi_gpio_acpi_match); >> +#endif > Don't know about this #ifdef, check if it is needed. > >> +#ifdef CONFIG_OF >> +static const struct of_device_id hisi_gpio_dts_match[] = { >> + { .compatible = "hisilicon,gpio-ascend910", }, >> + { } >> +}; >> +MODULE_DEVICE_TABLE(of, hisi_gpio_dts_match); >> +#endif > Drop the ifdef, it is not needed. > >> static void hisi_gpio_get_pdata(struct device *dev, >> struct hisi_gpio *hisi_gpio) >> @@ -310,7 +322,8 @@ static int hisi_gpio_probe(struct platform_device *pdev) >> static struct platform_driver hisi_gpio_driver = { >> .driver = { >> .name = HISI_GPIO_DRIVER_NAME, >> - .acpi_match_table = hisi_gpio_acpi_match, >> + .acpi_match_table = ACPI_PTR(hisi_gpio_acpi_match), >> + .of_match_table = of_match_ptr(hisi_gpio_dts_match), > Drop of_match_ptr() just assign it. > > The reason it works is because we put struct of_device_id into the generic > headers so we can avoid the ifdefing. > > Yours, > Linus Walleij Thank for your review,I get it,and make  improvements in subsequent patches. Best regards, Weilong Chen. > .