Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1097544imw; Tue, 5 Jul 2022 03:50:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vElMgNmJ/xgAkFqjETfR0OziKrNqjXAEq5l4hAjMJmP3RmqorWfiEty9CIq0QPnlKNnsgG X-Received: by 2002:a17:90b:1004:b0:1ef:9f33:2df4 with SMTP id gm4-20020a17090b100400b001ef9f332df4mr1733064pjb.31.1657018255421; Tue, 05 Jul 2022 03:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657018255; cv=none; d=google.com; s=arc-20160816; b=oNyMzHNTudXPQwYzLg9XGZJ7bLecjj1nmsAE22uHfAwpAW4sJxQ0WZVahJPsys0RDQ ewNsDphlWG5XrsY8h8Uzg8DPEb0Wt9tJ49MfJLeExRoXRvuSxebFXp3v5p091Et/hzyN yzsQAF3gIGBhTpMQEUkoLitRBEoaaIiHeOy+ERVBVlOnuPALdVNGTr8Sw7xMwqssdj3T FGS2AU97EA4x43dEaXLTU5HRYc51dyQi9kCwsMIhiaGFt/M8wfSeJ92xLsYf7dQ/+zwm jht6DgO5ZSJwFoStdtdggQ84HhAhckJlxJ2zebsFxLBKbJJajjIHpxtFwr6qP7cT3s1a hiyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8etHjP9NB2AEzDxGeqW3akKDdSo8OiEzz0+PEyCVcMI=; b=OSpOGmh4cit8pdsgNoS77XwlwQ+KoMo96XOaUCclwy4PhA6aapg2hkN1tnF+dep6C5 gMwSoflVQkGwBCAKhkFoe5VQuEdZkOx6+6m4tkRBaG5l9ZylKE1cmv0LylohwMYWWgd2 1JePUNo719Gf79Wu9I0AyAweb+NB+LwRHA3rarXj9+kiCaqnV1qovOYorTo68C4ox8kw /lVXBGuWSj6LHK7WFS/MTERRumHNa+/mQ/DKsrOC6PMHxiBhZxZafTONq55YrcdW+lks cauYP6J+96dr/qcX7jx4QYwMywfSXH5a+hzlX0AntJnUfyy8B5mwptyEFXNnajsvpKEx w+fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e40iovbV; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ip3-20020a17090b314300b001ef9db1a2d9si1602120pjb.100.2022.07.05.03.50.42; Tue, 05 Jul 2022 03:50:55 -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=@gmail.com header.s=20210112 header.b=e40iovbV; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232322AbiGEKax (ORCPT + 99 others); Tue, 5 Jul 2022 06:30:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232126AbiGEKa3 (ORCPT ); Tue, 5 Jul 2022 06:30:29 -0400 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D50A15833; Tue, 5 Jul 2022 03:30:06 -0700 (PDT) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-31caffa4a45so32519027b3.3; Tue, 05 Jul 2022 03:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8etHjP9NB2AEzDxGeqW3akKDdSo8OiEzz0+PEyCVcMI=; b=e40iovbVTXulHSh0GwhgN51kUXvZf4ISbfavw4qKV94xUm+8MdOKNcXq/EgWgUz5d8 BD9EyVlmIknBG+DOhCFTczbbpElxqDUOMAzRaYlQ/pZMcBzj/jxiol+KMxiZcTLPfg7c ZSXMeNy/Qb9z+thnamxGnmOMNtjZjqVMe6cWnldkEVYUJCDsX2I5OFpcznriK+CYWnai sHVEJ7MEzYL2DTIbWgf2sOjWZbIergf3EfBxrnlmQHSJdodopzgkUckqGOlv+TqU86b5 sHpK0dSod4Ah58nnOOLL9RCjIfXqBGQQM/TGTCUWW/eZHrx39k7vN3f+Et5P9czC6hRv dKZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8etHjP9NB2AEzDxGeqW3akKDdSo8OiEzz0+PEyCVcMI=; b=aZjztgCWoafc7LeggEXjSppc9SuNVDbqOnvy+65zEirRE1oTol9paAbXCNe2mEdtRN BFM+0lTkWzo5I0L5Rb7aDwaj/ZsPGDrcA7Y8bATjg+iyUcZJSjvp97O6dfSoMZdeICmg o/IjoJI/H6G0I4ZvcDdsuRjnZD4jDSQ/HeUSAs1QSpiaToUjny+xbCUM9LfzntHmMszE yf0K6214Y57Q9DQDGVsfyG3pdsSNmXvh1kaVU1L5091B2jjXIXXnXW69e5oPzekSr2wp tA+ZaBchXWF7e808GumuU3xibUqVNiQRAHiWGDGjF0pIXVJ8JaSBFwWYloOIMgUGfwln bIKQ== X-Gm-Message-State: AJIora9N79klqOmt5kIxmHGBsJm7rmVKWhXmt58l10QMiXCKNDt5jJIY eZSoWJRyZPKtguRDSACSM96hdzYmujdy+SlJNZI= X-Received: by 2002:a81:3984:0:b0:31c:b59e:a899 with SMTP id g126-20020a813984000000b0031cb59ea899mr6131611ywa.195.1657017005324; Tue, 05 Jul 2022 03:30:05 -0700 (PDT) MIME-Version: 1.0 References: <12026357.O9o76ZdvQC@kreacher> <2657553.mvXUDI8C0e@kreacher> <5606189.DvuYhMxLoT@kreacher> <61fbd71b-9c36-345c-7aed-561b81c34259@huawei.com> <71dfc3cd-c2ae-8096-9280-67e77c21055e@huawei.com> <050e5a2f-42b9-f851-ec6e-e2a9d3fdbe1c@huawei.com> In-Reply-To: <050e5a2f-42b9-f851-ec6e-e2a9d3fdbe1c@huawei.com> From: Andy Shevchenko Date: Tue, 5 Jul 2022 12:29:27 +0200 Message-ID: Subject: Re: [PATCH v3] hisi_lpc: Use acpi_dev_for_each_child() To: John Garry Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Linux ACPI , LKML , Andy Shevchenko , Greg Kroah-Hartman , Yang Yingliang Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Tue, Jul 5, 2022 at 12:16 PM John Garry wrote: > 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: ... > >> 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? I prefer having an ops or so structure where you can pass ->fixup() and/or ->xlate() function, Btw, it looks like the code in hisi_lpc needs a lot of cleanups. -- With Best Regards, Andy Shevchenko