From nobody Mon Apr 6 19:57:54 2026 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 70ADEECAAA1 for ; Mon, 5 Sep 2022 08:31:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237891AbiIEIbf (ORCPT ); Mon, 5 Sep 2022 04:31:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237668AbiIEIbC (ORCPT ); Mon, 5 Sep 2022 04:31:02 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4593AE5B for ; Mon, 5 Sep 2022 01:29:28 -0700 (PDT) Received: from fraeml738-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MLhW21NTCz68562; Mon, 5 Sep 2022 16:28:46 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) 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.31; Mon, 5 Sep 2022 10:29:26 +0200 Received: from localhost.localdomain (10.69.192.58) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 09:29:24 +0100 From: John Garry To: CC: , , , , , , John Garry Subject: [PATCH v3 1/5] bus: hisi_lpc: Don't dereference fwnode handle Date: Mon, 5 Sep 2022 16:23:02 +0800 Message-ID: <1662366186-233933-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1662366186-233933-1-git-send-email-john.garry@huawei.com> References: <1662366186-233933-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Andy Shevchenko Use dev_fwnode() and acpi_fwnode_handle() instead of dereferencing an fwnode handle directly, which is a better coding practice. While at it, reuse fwnode instead of ACPI_COMPANION(). Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 2e564803e786..6d432a07cbba 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -347,7 +347,7 @@ static int hisi_lpc_acpi_xlat_io_res(struct acpi_device= *adev, unsigned long sys_port; resource_size_t len =3D resource_size(res); =20 - sys_port =3D logic_pio_trans_hwaddr(&host->fwnode, res->start, len); + sys_port =3D logic_pio_trans_hwaddr(acpi_fwnode_handle(host), res->start,= len); if (sys_port =3D=3D ~0UL) return -EFAULT; =20 @@ -615,7 +615,6 @@ static void hisi_lpc_acpi_remove(struct device *hostdev) static int hisi_lpc_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; - struct acpi_device *acpi_device =3D ACPI_COMPANION(dev); struct logic_pio_hwaddr *range; struct hisi_lpc_dev *lpcdev; resource_size_t io_end; @@ -637,7 +636,7 @@ static int hisi_lpc_probe(struct platform_device *pdev) if (!range) return -ENOMEM; =20 - range->fwnode =3D dev->fwnode; + range->fwnode =3D dev_fwnode(dev); range->flags =3D LOGIC_PIO_INDIRECT; range->size =3D PIO_INDIRECT_SIZE; range->hostdata =3D lpcdev; @@ -651,7 +650,7 @@ static int hisi_lpc_probe(struct platform_device *pdev) } =20 /* register the LPC host PIO resources */ - if (acpi_device) + if (is_acpi_device_node(range->fwnode)) ret =3D hisi_lpc_acpi_probe(dev); else ret =3D of_platform_populate(dev->of_node, NULL, NULL, dev); @@ -672,11 +671,10 @@ static int hisi_lpc_probe(struct platform_device *pde= v) static int hisi_lpc_remove(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; - struct acpi_device *acpi_device =3D ACPI_COMPANION(dev); struct hisi_lpc_dev *lpcdev =3D dev_get_drvdata(dev); struct logic_pio_hwaddr *range =3D lpcdev->io_host; =20 - if (acpi_device) + if (is_acpi_device_node(range->fwnode)) hisi_lpc_acpi_remove(dev); else of_platform_depopulate(dev); --=20 2.35.3 From nobody Mon Apr 6 19:57:54 2026 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 D21E5ECAAA1 for ; Mon, 5 Sep 2022 08:31:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236756AbiIEIbi (ORCPT ); Mon, 5 Sep 2022 04:31:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237845AbiIEIbD (ORCPT ); Mon, 5 Sep 2022 04:31:03 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5273CE3B for ; Mon, 5 Sep 2022 01:29:31 -0700 (PDT) Received: from fraeml736-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MLhVr0R65z684kT; Mon, 5 Sep 2022 16:28:36 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml736-chm.china.huawei.com (10.206.15.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 10:29:29 +0200 Received: from localhost.localdomain (10.69.192.58) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 09:29:26 +0100 From: John Garry To: CC: , , , , , , John Garry Subject: [PATCH v3 2/5] bus: hisi_lpc: Use devm_platform_ioremap_resource Date: Mon, 5 Sep 2022 16:23:03 +0800 Message-ID: <1662366186-233933-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1662366186-233933-1-git-send-email-john.garry@huawei.com> References: <1662366186-233933-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Andy Shevchenko The struct resource is not used for anything else, so we can simplify the code a bit by using the helper function. Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 6d432a07cbba..03d4d96ff794 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -618,7 +618,6 @@ static int hisi_lpc_probe(struct platform_device *pdev) struct logic_pio_hwaddr *range; struct hisi_lpc_dev *lpcdev; resource_size_t io_end; - struct resource *res; int ret; =20 lpcdev =3D devm_kzalloc(dev, sizeof(*lpcdev), GFP_KERNEL); @@ -627,8 +626,7 @@ static int hisi_lpc_probe(struct platform_device *pdev) =20 spin_lock_init(&lpcdev->cycle_lock); =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - lpcdev->membase =3D devm_ioremap_resource(dev, res); + lpcdev->membase =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(lpcdev->membase)) return PTR_ERR(lpcdev->membase); =20 --=20 2.35.3 From nobody Mon Apr 6 19:57:54 2026 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 B55C2C6FA86 for ; Mon, 5 Sep 2022 08:31:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237907AbiIEIbl (ORCPT ); Mon, 5 Sep 2022 04:31:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237825AbiIEIbH (ORCPT ); Mon, 5 Sep 2022 04:31:07 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09CFF1145C for ; Mon, 5 Sep 2022 01:29:33 -0700 (PDT) Received: from fraeml737-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MLhVt2C9xz67yFy; Mon, 5 Sep 2022 16:28:38 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml737-chm.china.huawei.com (10.206.15.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 10:29:31 +0200 Received: from localhost.localdomain (10.69.192.58) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 09:29:29 +0100 From: John Garry To: CC: , , , , , , John Garry Subject: [PATCH v3 3/5] bus: hisi_lpc: Correct error code for timeout Date: Mon, 5 Sep 2022 16:23:04 +0800 Message-ID: <1662366186-233933-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1662366186-233933-1-git-send-email-john.garry@huawei.com> References: <1662366186-233933-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Andy Shevchenko The usual error code is -ETIMEDOUT, the currently used -ETIME is specific for timers. Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 03d4d96ff794..a6513a571d7b 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -85,7 +85,7 @@ static int wait_lpc_idle(void __iomem *mbase, unsigned in= t waitcnt) ndelay(LPC_NSEC_PERWAIT); } while (--waitcnt); =20 - return -ETIME; + return -ETIMEDOUT; } =20 /* --=20 2.35.3 From nobody Mon Apr 6 19:57:54 2026 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 A2446ECAAA1 for ; Mon, 5 Sep 2022 08:31:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237212AbiIEIbp (ORCPT ); Mon, 5 Sep 2022 04:31:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236693AbiIEIbI (ORCPT ); Mon, 5 Sep 2022 04:31:08 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 621121209C for ; Mon, 5 Sep 2022 01:29:36 -0700 (PDT) Received: from fraeml735-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MLhRM6Pwlz688sr; Mon, 5 Sep 2022 16:25:35 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml735-chm.china.huawei.com (10.206.15.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 10:29:34 +0200 Received: from localhost.localdomain (10.69.192.58) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 09:29:31 +0100 From: John Garry To: CC: , , , , , , John Garry Subject: [PATCH v3 4/5] bus: hisi_lpc: Don't guard ACPI IDs with ACPI_PTR() Date: Mon, 5 Sep 2022 16:23:05 +0800 Message-ID: <1662366186-233933-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1662366186-233933-1-git-send-email-john.garry@huawei.com> References: <1662366186-233933-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Andy Shevchenko The OF ID table is not guarded, and the ACPI table does not needs it either. The IDs do not depend on the configuration. Hence drop ACPI_PTR() from the code and move ID table closer to its user. Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index a6513a571d7b..74f4448bff9d 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -589,11 +589,6 @@ static int hisi_lpc_acpi_probe(struct device *hostdev) =20 return ret; } - -static const struct acpi_device_id hisi_lpc_acpi_match[] =3D { - {"HISI0191"}, - {} -}; #else static int hisi_lpc_acpi_probe(struct device *dev) { @@ -688,11 +683,16 @@ static const struct of_device_id hisi_lpc_of_match[] = =3D { {} }; =20 +static const struct acpi_device_id hisi_lpc_acpi_match[] =3D { + {"HISI0191"}, + {} +}; + static struct platform_driver hisi_lpc_driver =3D { .driver =3D { .name =3D DRV_NAME, .of_match_table =3D hisi_lpc_of_match, - .acpi_match_table =3D ACPI_PTR(hisi_lpc_acpi_match), + .acpi_match_table =3D hisi_lpc_acpi_match, }, .probe =3D hisi_lpc_probe, .remove =3D hisi_lpc_remove, --=20 2.35.3 From nobody Mon Apr 6 19:57:54 2026 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 1FA98ECAAA1 for ; Mon, 5 Sep 2022 08:31:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237395AbiIEIbv (ORCPT ); Mon, 5 Sep 2022 04:31:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236849AbiIEIbJ (ORCPT ); Mon, 5 Sep 2022 04:31:09 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E407413E07 for ; Mon, 5 Sep 2022 01:29:38 -0700 (PDT) Received: from fraeml734-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MLhWC4KbTz6889W; Mon, 5 Sep 2022 16:28:55 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml734-chm.china.huawei.com (10.206.15.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 10:29:36 +0200 Received: from localhost.localdomain (10.69.192.58) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Sep 2022 09:29:34 +0100 From: John Garry To: CC: , , , , , , John Garry Subject: [PATCH v3 5/5] bus: hisi_lpc: Use platform_device_register_full() Date: Mon, 5 Sep 2022 16:23:06 +0800 Message-ID: <1662366186-233933-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1662366186-233933-1-git-send-email-john.garry@huawei.com> References: <1662366186-233933-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The code to create the child platform device is essentially the same as what platform_device_register_full() does, so change over to use that same function to reduce duplication. Signed-off-by: John Garry Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko --- drivers/bus/hisi_lpc.c | 68 ++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 74f4448bff9d..5b65a48f17e7 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -472,9 +472,7 @@ static int hisi_lpc_acpi_clear_enumerated(struct acpi_d= evice *adev, void *not_us =20 struct hisi_lpc_acpi_cell { const char *hid; - const char *name; - void *pdata; - size_t pdata_size; + const struct platform_device_info *pdevinfo; }; =20 static void hisi_lpc_acpi_remove(struct device *hostdev) @@ -505,28 +503,45 @@ static int hisi_lpc_acpi_add_child(struct acpi_device= *child, void *data) /* ipmi */ { .hid =3D "IPI0001", - .name =3D "hisi-lpc-ipmi", + .pdevinfo =3D (struct platform_device_info []) { + { + .parent =3D hostdev, + .fwnode =3D acpi_fwnode_handle(child), + .name =3D "hisi-lpc-ipmi", + .id =3D PLATFORM_DEVID_AUTO, + .res =3D res, + .num_res =3D num_res, + }, + }, }, /* 8250-compatible uart */ { .hid =3D "HISI1031", - .name =3D "serial8250", - .pdata =3D (struct plat_serial8250_port []) { + .pdevinfo =3D (struct platform_device_info []) { { - .iobase =3D res->start, - .uartclk =3D 1843200, - .iotype =3D UPIO_PORT, - .flags =3D UPF_BOOT_AUTOCONF, + .parent =3D hostdev, + .fwnode =3D acpi_fwnode_handle(child), + .name =3D "serial8250", + .id =3D PLATFORM_DEVID_AUTO, + .res =3D res, + .num_res =3D num_res, + .data =3D (struct plat_serial8250_port []) { + { + .iobase =3D res->start, + .uartclk =3D 1843200, + .iotype =3D UPIO_PORT, + .flags =3D UPF_BOOT_AUTOCONF, + }, + {} + }, + .size_data =3D 2 * sizeof(struct plat_serial8250_port), }, - {} }, - .pdata_size =3D 2 * - sizeof(struct plat_serial8250_port), }, {} }; =20 - for (; cell && cell->name; cell++) { + for (; cell && cell->hid; cell++) { if (!strcmp(cell->hid, hid)) { found =3D true; break; @@ -540,31 +555,12 @@ static int hisi_lpc_acpi_add_child(struct acpi_device= *child, void *data) return 0; } =20 - pdev =3D platform_device_alloc(cell->name, PLATFORM_DEVID_AUTO); - if (!pdev) - return -ENOMEM; - - pdev->dev.parent =3D hostdev; - ACPI_COMPANION_SET(&pdev->dev, child); - - ret =3D platform_device_add_resources(pdev, res, num_res); - if (ret) - goto fail; - - ret =3D platform_device_add_data(pdev, cell->pdata, cell->pdata_size); - if (ret) - goto fail; - - ret =3D platform_device_add(pdev); - if (ret) - goto fail; + pdev =3D platform_device_register_full(cell->pdevinfo); + if (IS_ERR(pdev)) + return PTR_ERR(pdev); =20 acpi_device_set_enumerated(child); return 0; - -fail: - platform_device_put(pdev); - return ret; } =20 /* --=20 2.35.3