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: 636211 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 8AD8EC001B2 for ; Thu, 22 Dec 2022 19:15:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235519AbiLVTPg (ORCPT ); Thu, 22 Dec 2022 14:15:36 -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 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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);