From patchwork Thu Dec 22 19:14:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 35920 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp122810wrn; Thu, 22 Dec 2022 11:20:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXu+uJHWk0UaHfGflAlQHzeSQO67+szAifirWVpUNSPHzZyv5UkhVPzLJGcmQ5WlDrt4/o/c X-Received: by 2002:a62:ed08:0:b0:577:272f:fdb with SMTP id u8-20020a62ed08000000b00577272f0fdbmr5913434pfh.29.1671736806799; Thu, 22 Dec 2022 11:20:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671736806; cv=none; d=google.com; s=arc-20160816; b=FJ5ySTMZ2CQeiuPoOrUjTxKwBSg0rIFBi+5Ou/kapbROOo3FbZhb4hjntvdl6VawYa bvWSWeBLAux+pKwQMY0U21EGUKiP6unIH8NXXs5BWi2c5gVyZrERlybRC/x/FFzUpdTZ tslTq5jWreIM/4T3UCo1MiBmuo6JrIaQcKJPyuCaxfsJfP88cq5EMe0M2sftxPgaeCPm 8ZEPZzu3IMbjSPtjYK8OHbpRbT1CsYhIkzcETrWGjLN95CeSa+ISAif/uVXMoxDXvfhJ eCQj0Pb7r/ltdq22WUiwwXxJnKOaoiG/dgk2sN9SU81ozflytk2OEg/PajNOr2Z7gBeD 2QQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/g6c/kkciUBQItbF+Vmmebv62h5qUeG2Zc3SKsvElFM=; b=mWgvsxNGkQy5DfqQRkvlA99amXbgsYfLWMmT9m5t9OLEXtPbNlEneiMlQ4EBQrCA0r VnAnW6iUCPuGB0v0T5yzbCzy3E98AORLw+1IbhllsptE1hOIFOvxoLfETk2R9v0l88gv 55VzgyiX2yaE9yvjEJ5fOQ9cHlJcjeA+G3NE5XUBkspjjqEelMfD+yQ488qsFl5LG8kq MAdAK4gHYzQ6glbDHzmj7//yubIj+qA547YmWuabwmeFQ+//slh8mAKLZ9bwJxlXqb+t mCx9qIMRDdQkMERq+Ij4ggKUPa2Zv6D13GAoyv3BuqxZyaHhDaS1w5tX+6I16yuhNPGD FSPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Tl8lcCTt; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t1-20020a056a0021c100b00536ee478380si1586075pfj.7.2022.12.22.11.19.53; Thu, 22 Dec 2022 11:20:06 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Tl8lcCTt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235531AbiLVTPh (ORCPT + 99 others); Thu, 22 Dec 2022 14:15:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235454AbiLVTPd (ORCPT ); Thu, 22 Dec 2022 14:15:33 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FDB328E38; Thu, 22 Dec 2022 11:15:31 -0800 (PST) Received: from umang.jainideasonboard.com (unknown [IPv6:2401:4900:1f3f:d076:4da6:b729:f032:ed0a]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 56073471; Thu, 22 Dec 2022 20:15:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1671736530; bh=bqvMP11pqYGYAC5IZOywqjG3I9GF/0iY9Gg7h2H8QBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tl8lcCTtBojKEuNJ8j+cnCa7NsqslZ/z3PEjsWPTzSUny88AVie/m6bS1/CJfboa4 yhk8NKmdqAN/+nuzHtsQhOui3SeFIdyhWigmoReRGlfp5e52gmnIvExLyXf5cvh27u m+01+akz6BoJrrgkRVYJEjxXAwz10DXh4qkfN1qU= From: Umang Jain To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Greg Kroah-Hartman , Adrien Thierry , Stefan Wahren , Florian Fainelli , Dan Carpenter , Nicolas Saenz Julienne , Phil Elwell , Dave Stevenson , Kieran Bingham , Laurent Pinchart , Umang Jain Subject: [PATCH v2 3/4] staging: vchiq: Simplify platform devices registration Date: Fri, 23 Dec 2022 00:44:59 +0530 Message-Id: <20221222191500.515795-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221222191500.515795-1-umang.jain@ideasonboard.com> References: <20221222191500.515795-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752943093774972950?= X-GMAIL-MSGID: =?utf-8?q?1752943093774972950?= The child platform devices registered by the vchiq driver currently populates a struct platform_device_info with a name and parent device and uses platform_device_register_full() to its registration. It can be simplified by using platform_device_register_data() directly (which encapsulates populating the platform_device_info struct and a platform_device_register_full() call in itself). Signed-off-by: Umang Jain --- .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 3c4766375daa..ba34e4d603d4 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1766,16 +1766,10 @@ MODULE_DEVICE_TABLE(of, vchiq_of_match); static struct platform_device * vchiq_register_child(struct platform_device *pdev, const char *name) { - struct platform_device_info pdevinfo; struct platform_device *child; - memset(&pdevinfo, 0, sizeof(pdevinfo)); - - pdevinfo.parent = &pdev->dev; - pdevinfo.name = name; - pdevinfo.id = PLATFORM_DEVID_NONE; - - child = platform_device_register_full(&pdevinfo); + child = platform_device_register_data(&pdev->dev, name, PLATFORM_DEVID_NONE, + NULL, 0); if (IS_ERR(child)) { dev_warn(&pdev->dev, "%s not registered\n", name); platform_device_put(child);