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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46544C433EF for ; Tue, 5 Jul 2022 10:16:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231709AbiGEKQP (ORCPT ); Tue, 5 Jul 2022 06:16:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231281AbiGEKQO (ORCPT ); Tue, 5 Jul 2022 06:16:14 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E96EC1400B; Tue, 5 Jul 2022 03:16:12 -0700 (PDT) Received: from fraeml738-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4LcdmW3817z67sh5; Tue, 5 Jul 2022 18:13:31 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml738-chm.china.huawei.com (10.206.15.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 5 Jul 2022 12:16:10 +0200 Received: from [10.126.171.232] (10.126.171.232) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.24; Tue, 5 Jul 2022 11:16:09 +0100 Message-ID: <050e5a2f-42b9-f851-ec6e-e2a9d3fdbe1c@huawei.com> Date: Tue, 5 Jul 2022 11:16:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v3] hisi_lpc: Use acpi_dev_for_each_child() To: Andy Shevchenko CC: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Linux ACPI , LKML , Andy Shevchenko , Greg Kroah-Hartman , Yang Yingliang References: <12026357.O9o76ZdvQC@kreacher> <2657553.mvXUDI8C0e@kreacher> <5606189.DvuYhMxLoT@kreacher> <61fbd71b-9c36-345c-7aed-561b81c34259@huawei.com> <71dfc3cd-c2ae-8096-9280-67e77c21055e@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.126.171.232] X-ClientProxiedBy: lhreml703-chm.china.huawei.com (10.201.108.52) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On 05/07/2022 10:39, Andy Shevchenko wrote: > On Tue, Jul 5, 2022 at 11:38 AM Andy Shevchenko > wrote: >> On Tue, Jul 5, 2022 at 10:37 AM John Garry wrote: >>> On 04/07/2022 20:02, Rafael J. Wysocki wrote: >> ... >> >>> I gave these a quick test on my board and they look fine. >>> >>> Acked-by: John Garry >> John, I believe now you may send a formal clean up to convert to platform_device > Hit Enter too early:-) > > ...to platform_device_register_full(). Sure, I can look at that now. But I just found where we previously mentioned the possibility of factoring out some of the ACPI platform device creation code: https://lore.kernel.org/linux-acpi/CAHp75VfOa5pN4MKT-aQmWBwPGWsOaQupyfrN-weWwfR3vMLtuA@mail.gmail.com/ There is actually still a comment in the hisi_lpc driver - I should have checked there first :) So my impression is that the hisi_lpc code is almost the same in acpi_create_platform_device(), apart from we need do the resource fixup in hisi_lpc_acpi_set_io_res(). So we could factor out by dividing acpi_create_platform_device() into 2x parts: resource get and then platform dev create. But that does not seem wise as we have 2x parts which don't make sense on their own. Or else pass a fixup callback into acpi_create_platform_device(). Any other ideas if we want to go this way? Thanks, John