From nobody Thu Apr 2 22:22:20 2026 Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 417DF212F89 for ; Sat, 14 Feb 2026 02:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771037574; cv=none; b=tF6BOOrUoRTlOCorVZqT7rItLkS1VztbKWxSmCBC3NAHrjCcbty9q8md9+lzL1WX8w2HOdBzAty4oPFXpSXDEeP6AipcyqBp5bfskmPLLWfA2H38TvWzKbq4Dn+n1bbxQxNMxG0YXxJ4b6JybDQxOC2d+w2qF7ntxDQhc7zPOrY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771037574; c=relaxed/simple; bh=ZCjgJa1q1ef26Uzc5lZB5kDeX4Sp5b/8xxGjMT9pBKE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X3TBe2h4x3+alOLOjRgJCqKXnu/z+iBOcrGnQAg+2WENw3QWjU4A3OGJoPYhn5v4qVViiodPvOuC+oVHH8cOgUx3jggxBQE9lStfvBPxcJr3QS8F1156EyvrGDx4tvm1PT9Zxr76QE8gty9ZqCuYV+Cc0nzE812rcR8H6guBCkY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GjMRxd3n; arc=none smtp.client-ip=74.125.82.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GjMRxd3n" Received: by mail-dy1-f178.google.com with SMTP id 5a478bee46e88-2ba6aa57d5fso1626495eec.1 for ; Fri, 13 Feb 2026 18:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771037572; x=1771642372; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KyigEN7r87jNeejhSKAK4DhbusMJoWTQIc/5u56FEas=; b=GjMRxd3nPhHlnU/gGwHdaGnZX3W6PnGzcwMmL2K6zSgev1ZscKa8J7hnna9/BZlktb h0O+11iGeb5+Hx6W/DTkeS9dZ3LJH8+YIeeHF0T4AAilGHYCUYT+g6xAXPnlWx0CPX/1 R2JOM7osqPszMZ5X5FZIvoGxvLMNLlTBQ5Ue/g0dPeCMCNtuak1JSZSRDy5CWZihe6tW MBFZ3HU4y+/Bnjzrfg3LxyzFBH2wIF3WSus3OGvvb8s5dxHo1Dbh48z5JJYPLTRlI+3L /jJ4++ButbEvdj98g6vGpbMTrVQ+I6tlyhogR+YKiXi7vMYRxpa1VUb+nO54uFTQynSK 28sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771037572; x=1771642372; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KyigEN7r87jNeejhSKAK4DhbusMJoWTQIc/5u56FEas=; b=QdlLFs+RnmMlxDbmRsX10btpFSsjfzE/EQAQd/utOY7eJtV3g3UZLqzWjFo0Vcsvam OJESTDDARaE35V4XpYEQFMSz0ruX2ywMLolGD+H0L1Wz6TXshuelEd+rw0f2qQBtystm 1cpy8gDkp5OLHXgYhiD6e4zgZleWsGPD3rY0ou+qXn1563/JB80/KKVI1eRddxOfCjXZ /yqK/AXQhZZzGnzYNF8IKl0r6KxDe3B8V+ESsdjBbFxxNcIgZLa3wQ1xOyOeHQ8Py8Ll OyXff+vEBaHnCKJkvDklspHHy84myuiRLM13IsNhpNmjf93u6jFYg3A5HrO5FJjkiZjV da7w== X-Forwarded-Encrypted: i=1; AJvYcCUpK/6ZS2ayS8rBKDC5OOCp0/2zqC2YKDpbfPlJy3k1/6/BL+JfYq1ysXKPS0uwp6N9sANY9nQxQimIfdk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3dsUE65k/2F1SnYfRm3HM+pQbCQzx442L2HhgoGWovet1lbse O3GxXlz/wovDduTX0RmqqcNFwkzguu90BAUfRFUWsn8zqqCwet96ZrPz X-Gm-Gg: AZuq6aIh1HmUUpuhmziPQssl2qrcd4Xabd5fx6wjikFEkmb9Aw26LoPuvxkM71Os+6h Gg31D/EyXZRfK8ioX3T0X2byFso/dU6IcQHXdZ3KEwDey2T+cAJRdaHgzjDy8ARMItrjaT5Qy1O snOVyqzQtV1PKMv/9o3E27wyrFI8LAnQiswJ5iVw+oNoz7qquzAA4/ZxeE2QM0Utf04JZqJ7PFN myVLdaEBm2pSoSZxjcLtiakj6i5OdK7TJEqBxiwwLG8yme/YfQQBIxHqh8aj0grTpiSxgpduIKD +ynaY3wuYmUyCORAxi1f+iK1U93nRzhk09tTqblEOOS6Jwv0dmme7BGJZq8FTSphaJkQtxkrzKj WfH2f/GjbKS9k+MmWSjyRdNSsZtTkE206hPKErqjTWv+5HgT6VEZWvb+yftdS74YeaQJPxS2GWi GQx67NkzQpqyBDBe6GUQRUjvcQQHbtT1pz8v/DiFUvepnikm8ki7kWPJPqSafjkHJCiREfecGi0 s/bEcGX1NO1uhE= X-Received: by 2002:a05:7300:d517:b0:2b8:64ad:ad4c with SMTP id 5a478bee46e88-2bac97cab51mr512822eec.31.1771037572160; Fri, 13 Feb 2026 18:52:52 -0800 (PST) Received: from dtor-ws.sjc.corp.google.com ([2a00:79e0:2ebe:8:b713:5e7b:5963:d2ad]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2bacb543d4dsm638589eec.7.2026.02.13.18.52.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Feb 2026 18:52:51 -0800 (PST) From: Dmitry Torokhov To: Greg Kroah-Hartman , Danilo Krummrich Cc: "Rafael J. Wysocki" , Arnd Bergmann , Bartosz Golaszewski , Hans de Goede , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] driver core: platform: add kerneldoc to struct platform_device_info Date: Fri, 13 Feb 2026 18:52:43 -0800 Message-ID: <20260214025246.2095239-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.53.0.310.g728cabbaf7-goog In-Reply-To: <20260214025246.2095239-1-dmitry.torokhov@gmail.com> References: <20260214025246.2095239-1-dmitry.torokhov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add kernel documentation for struct platform_device_info and its individual members. While at it remove an extra indent level from the structure definition. Signed-off-by: Dmitry Torokhov Reviewed-by: Bartosz Golaszewski --- include/linux/platform_device.h | 53 ++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/include/linux/platform_device.h b/include/linux/platform_devic= e.h index 813da101b5bf..5f54217930e1 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -118,22 +118,53 @@ extern int platform_get_irq_byname_optional(struct pl= atform_device *dev, const char *name); extern int platform_add_devices(struct platform_device **, int); =20 +/** + * struct platform_device_info - set of parameters for creating a platform= device + * @parent: parent device for the new platform device. + * @fwnode: firmware node associated with the device. + * @of_node_reused: indicates that device tree node associated with the de= vice + * is shared with another device, typically its ancestor. Setting this to + * %true prevents the device from being matched via the OF match table, + * and stops the device core from automatically binding pinctrl + * configuration to avoid disrupting the other device. + * @name: name of the device. + * @id: instance ID of the device. Use %PLATFORM_DEVID_NONE if there is on= ly + * one instance of the device, or %PLATFORM_DEVID_AUTO to let the + * kernel automatically assign a unique instance ID. + * @res: set of resources to attach to the device. + * @num_res: number of entries in @res. + * @data: device-specific data for this platform device. + * @size_data: size of device-specific data. + * @dma_mask: DMA mask for the device. + * @properties: a set of software properties for the device. If provided, + * a managed software node will be automatically created and + * assigned to the device. The properties array must be terminated + * with a sentinel entry. + * + * This structure is used to hold information needed to create and register + * a platform device using platform_device_register_full(). + * + * platform_device_register_full() makes deep copies of @name, @res, @data= and + * @properties, so the caller does not need to keep them after registratio= n. + * If the registration is performed during initialization, these can be ma= rked + * as __initconst. + */ struct platform_device_info { - struct device *parent; - struct fwnode_handle *fwnode; - bool of_node_reused; + struct device *parent; + struct fwnode_handle *fwnode; + bool of_node_reused; =20 - const char *name; - int id; + const char *name; + int id; =20 - const struct resource *res; - unsigned int num_res; + const struct resource *res; + unsigned int num_res; =20 - const void *data; - size_t size_data; - u64 dma_mask; + const void *data; + size_t size_data; + u64 dma_mask; =20 - const struct property_entry *properties; + const struct property_entry *properties; }; extern struct platform_device *platform_device_register_full( const struct platform_device_info *pdevinfo); --=20 2.53.0.310.g728cabbaf7-goog From nobody Thu Apr 2 22:22:20 2026 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 193FB25EFBB for ; Sat, 14 Feb 2026 02:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771037575; cv=none; b=SjxFK3kA6OJbhbD6AVuKtBgJWuXz5rDq2tY5R9BcKvT/EXIUhLm+r++Z6wuqoCtYQWnTiQIIr8do9QwKm68ZQiwGsnj/jGPGeCcLjo7IoxKxF8jH917GMUh0TTYCaRQ34BAdfNzeTBxq/N2xuzqGpFD+63iWEV+Bxeuy0c65sj0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771037575; c=relaxed/simple; bh=EGk4TCrdn3IRKjHAY5Ie9SNff5JA4Z6mIE22vYqG4Uo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QjHINSSWqLtH6bOgH5zWDWJHKFyqkn4ntG+G2GoS+5B239O/z0XYCAxFPwBSyl87vem+pAnY9SIr6N41BW0Bbfsc6mOXxOYmCJVINP54h8DEvDTuQLjavkORmY1+f42wsvcSBLugfUPnyL0MbrojD0+bxAWhOdBGQNs9vzisA/g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eLZM/VBF; arc=none smtp.client-ip=74.125.82.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eLZM/VBF" Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-2b740872a01so2932620eec.1 for ; Fri, 13 Feb 2026 18:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771037573; x=1771642373; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1aI0cVbWKjKmEns6i5xEfUzr9NXilQjLjlKqgC/IsvU=; b=eLZM/VBF9zF/R1qn5gGER867KibPl3en4V2k3Xdh91GgmujoOEM0UCbfr7oXhncoPN bmI4sq+XbhdvxROkXK+iSbKw5uL9xVSjMC4G5vhGOUl1vSJIDWtjEXFglACIzGFQQIIP 6Qf8tMwnnYlHTf4CfJAZT8zJ8Tp7FXEW1rqeEAceFOHxyiGFSs47l1AH646jIfR4Agt5 8vWuOjfCiwRlI7UL7iKe+ic/qkxww+22ldK0LGgGcTs3r9+gR9gcjORqK6nJB6/3Kesc 2P9tuc+ioeo42zqsTls5yN+HQsiSQTWBR2P3w8k5hNXxS1AgfUWYZow8SJigrj/zb0cU Em8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771037573; x=1771642373; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1aI0cVbWKjKmEns6i5xEfUzr9NXilQjLjlKqgC/IsvU=; b=tZs+NbQmwrf5zwf9JN/M55QakJeZivm5jwALMRtk+5EKKqGQUxi5gW9FR7my9NrUPD lOLAKm2keAtqW36lXUClB0m05Q42t87PNfMSK+TG5XVtGN5+xMYCbZMNdvdC56bwkMNd kvRIshdPO+zjMpIKQ61g5F4KrxXJFwW0C61GVToRRsYljwAtbdfEa135hT2yNLaT2Bst lqQmlf9HYEvAeqp98HLnslOeIX83wznfqK0CMTdRy7p8X/zG94Ljfzj6NQEFpRFYgLvj oMeWm8uk3FpXQ1mGHM7qMcrS8rv10T5Nbk0OGw9kviS4xKcM9dOfU+omdz8vw5EcqMTT d9Cg== X-Forwarded-Encrypted: i=1; AJvYcCWDe1pwp9Qyb3asokNVOQIGGxMFM0qpGHOgZPPk8ZmdErhafCUul7i1uElEvvoC7fZG4iORWFTr9+C5Me8=@vger.kernel.org X-Gm-Message-State: AOJu0YzRda7Gaxgxa4IAJ4aVC5bucuVbrG1YzP2SXSevu99UWt7uEpWe FpSPv1pnfVLNxRsX0yjhP88NEwzqmRlKzRDrb1R7rpgOoTClE8Y/tEkk X-Gm-Gg: AZuq6aKcwOFB5ZbtBS0crJbANTWZNxrs/kZGDaC5e+uevIelP/OKDKfPNrxT+kcXDUj 4401aEMB2hM2VbUMaSs4bGfi+SMqvf3vBJdWCG0ORwudVaLU7qWkUAJnEt0GM6vt1GlbaedDoDD 7RBaShC5aAXDG5GpMlNiczGbAuczyXPydiSDBozL3+R9GqpOKmRadkLRB6E3wcUYRD32/wXvVXW qIhmPnipIPXZCX+KQuTrAyBVfBp61HiY9W5hxQp07e1U8+EGRmVf5hpOxJ6q1b6o8DBjmuW53gm U2odqyqcafVFwCDKQq3QJQT3xGGlaQebpTS8hjUd7pNHUDHR8how6i6u8qTpK3SzkGwANX8b9NR LEH5ITuTGcZdhTwv+CUKtOm0NcCipyvWb1O11hN2Q9zIKKU7vriLE/OTGO0/FR8MDPyQPhN38uc ySnXDPdGprOsBVWFT2skmp5+q38Qw4QaYCaNCvN1nbZ9lxMldvlgiCn6g0OGueaAM0qtd8S30wQ T6gKXkIL77ODmoVJcHQ5WaX6A== X-Received: by 2002:a05:7301:1e87:b0:2ba:7404:f582 with SMTP id 5a478bee46e88-2babc4be07cmr1771246eec.41.1771037573182; Fri, 13 Feb 2026 18:52:53 -0800 (PST) Received: from dtor-ws.sjc.corp.google.com ([2a00:79e0:2ebe:8:b713:5e7b:5963:d2ad]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2bacb543d4dsm638589eec.7.2026.02.13.18.52.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Feb 2026 18:52:52 -0800 (PST) From: Dmitry Torokhov To: Greg Kroah-Hartman , Danilo Krummrich Cc: "Rafael J. Wysocki" , Arnd Bergmann , Bartosz Golaszewski , Hans de Goede , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] driver core: platform: allow attaching software nodes when creating devices Date: Fri, 13 Feb 2026 18:52:44 -0800 Message-ID: <20260214025246.2095239-3-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.53.0.310.g728cabbaf7-goog In-Reply-To: <20260214025246.2095239-1-dmitry.torokhov@gmail.com> References: <20260214025246.2095239-1-dmitry.torokhov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Extend platform_device_info structure with an optional pointer to a software node to be used as a secondary firmware node for the device being created. If software node has not been registered yet it will be automatically registered. This reduces boilerplate needed when switching legacy board code to static device properties/GPIO references. Signed-off-by: Dmitry Torokhov Reviewed-by: Bartosz Golaszewski --- drivers/base/platform.c | 9 ++++++++- include/linux/platform_device.h | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index b45d41b018ca..ec467ccd05b3 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -850,6 +850,9 @@ struct platform_device *platform_device_register_full( int ret; struct platform_device *pdev; =20 + if (pdevinfo->swnode && pdevinfo->properties) + return ERR_PTR(-EINVAL); + pdev =3D platform_device_alloc(pdevinfo->name, pdevinfo->id); if (!pdev) return ERR_PTR(-ENOMEM); @@ -875,7 +878,11 @@ struct platform_device *platform_device_register_full( if (ret) goto err; =20 - if (pdevinfo->properties) { + if (pdevinfo->swnode) { + ret =3D device_add_software_node(&pdev->dev, pdevinfo->swnode); + if (ret) + goto err; + } else if (pdevinfo->properties) { ret =3D device_create_managed_software_node(&pdev->dev, pdevinfo->properties, NULL); if (ret) diff --git a/include/linux/platform_device.h b/include/linux/platform_devic= e.h index 5f54217930e1..754e4bf2771a 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -136,10 +136,14 @@ extern int platform_add_devices(struct platform_devic= e **, int); * @data: device-specific data for this platform device. * @size_data: size of device-specific data. * @dma_mask: DMA mask for the device. + * @swnode: a secondary software node to be attached to the device. The no= de + * will be automatically registered and its lifetime tied to the platform + * device if it is not registered yet. * @properties: a set of software properties for the device. If provided, * a managed software node will be automatically created and * assigned to the device. The properties array must be terminated - * with a sentinel entry. + * with a sentinel entry. Specifying both @properties and @swnode is not + * allowed. * * This structure is used to hold information needed to create and register * a platform device using platform_device_register_full(). @@ -164,6 +168,7 @@ struct platform_device_info { size_t size_data; u64 dma_mask; =20 + const struct software_node *swnode; const struct property_entry *properties; }; extern struct platform_device *platform_device_register_full( --=20 2.53.0.310.g728cabbaf7-goog From nobody Thu Apr 2 22:22:20 2026 Received: from mail-dy1-f179.google.com (mail-dy1-f179.google.com [74.125.82.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 011832882AA for ; Sat, 14 Feb 2026 02:52:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771037576; cv=none; b=PzElHnDI8NU4OeAXWyJti3DCoKJUxBI7CmHEgYs/utJLwiDOEUMfjN8IbKuSMOdZ2TKXKqqvRyrWEyqLOHuNzbzZzzd/x3kb8EmlhhnhnN8JDdNHdrLRIlGQv4h3Y9k33IhAnzV7y7FaUbO/2LVFgzZtItU/u43u1v3OPThgJ9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771037576; c=relaxed/simple; bh=v3kXvNSuCMZ7MEWDhVbIE5GD0XqGeatSF30MtYjqx54=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TNgWXbhs1O+23lFgaUDmbC+Df8FECOGDcnb3KpJeBrTkZ1wcoeY6SJFKUUMoB6xpkmN3kSnJPKKVflEfZfEWPF+rnIs8fsdn+07S21TORWkhatdaBdq9IlbSHh12VwC+x81qiCgIGzGixPEMV5zW9DMO1eoybjGIVPS9k+Aj9Sc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AKcYPW2d; arc=none smtp.client-ip=74.125.82.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AKcYPW2d" Received: by mail-dy1-f179.google.com with SMTP id 5a478bee46e88-2bab70f8c8aso1562954eec.1 for ; Fri, 13 Feb 2026 18:52:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771037574; x=1771642374; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/UOk9oh277SXACkh2cn1misUWWqitds3tO3PquLOoFQ=; b=AKcYPW2dWlUOvmT59+W/bIIC1qgdd6BjYa2lDmYA5NW2ThF6PU1PoWF+TTjXqMg0Rq nYcuVdPSbMag/Nk5od8pb0MQBw5i7tacuBETCmTR47VUys3UrJ0pk5IOOpuF8Q1cruQX w0zmUiGR/AaoKn4xvE0x3asGnlS7gQ7zshTs3oiyGWa3zR4mwXyDu79FVDQ1brl5/nHH UfwuXzjlKnkuTDZASRSBu1aAUkFaH7o+Iz9rGCCmQIFQsroFIfB4+CqwSAEuYyVrusXj GXyYn7lx2vxh+/wbOE+7bZRtLtOYztpXcFtuZ8L/16zrK4VU2zawTwv3jHUH+MCc4d0e llGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771037574; x=1771642374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/UOk9oh277SXACkh2cn1misUWWqitds3tO3PquLOoFQ=; b=EoDSvkXwQ8hVAG5V8OA5UXO+7sxJstphy+ajwtwb5+qsrT1YRybJOTFOXK7N7JXk3Q QpYaKFXUo4EFxXm3LaKSlQP2gNuHFCUDAF+Sicv/eMoCeDa0CcxOHbHFQaeKnZjm4mAQ HI8CGwdjV/WouPO2Wgm22wNtjwRy+L8J2pY9+f6O1Oj0E8V0ci1Lekwtez79jIttu3ji xIfslaA5O9Y1iBPQ28749l4Be5cxRekOR+6zOFg/2BDo+9GXFeR+dIrX7xzeSVqorx7n /jFTspUumOPiP37M+3EBxHqtuIpgRvmnN67fpDJA/D9KfMa01FLCFkHdAC0RZS5A6uEv Z3Ew== X-Forwarded-Encrypted: i=1; AJvYcCUplieaaH5F3uODnff4AOjmen2W4p4S2gUP8cConLryP8iNHn14ZeW06rmZNRc4VoWCSkyLTxm5Rokd5DA=@vger.kernel.org X-Gm-Message-State: AOJu0YxoSMMkghG0U3UWJDcAat9JjuU9e5uMC/WaSLS0Fjns9jJ84rs5 JyKgsgn+XFhIhJIOzfU7r5NeZx7iLPgiD8MCwLelEb3R/TKC2QCMZn6Q X-Gm-Gg: AZuq6aKWthjIphK+W/ThxiXDOuCMwCj6n9JKEul1evuj+JX0zynLs8legj2/S67EEH1 2RhFv2GK+VjH2xpxc8nKKeoVpoek4vU0hosxYW6Cv7C7ESjTfiKXe++w/sRV9VYJoaS07ZdmAgj 6pClHeS4dT2OMPaD3beKCKSmzw8nypTIWUMwERRRUaTESRcQ0obEUCgoej+kdKlJJJ2wKVffVVL rInugnBAqluhFaZCm+LAeiWpR7vVd7lm7WhEAECfPeJs29ZCvlqaiivh+DDv3ffxzmULka+BYLl iDgRoOved6nXU9FM9F7DXtSBgdnnVb9diAReNHLqn5EtH2QKXJ2Q41LmrDi8CWFzqgVsHUrUl53 9N+QY0+g4gz2xCUY6L5Nt/JExRbog23CHy6OOZzS6ZVjuz+zcz7SDt8LKOc2xtIBKQj8RtUhmWF gFh1tazZA5lFsiJM9FrIhconY1XqxAHbPGaJQofNsaPvnGAXQ6CMyh+XeuJXXIcLJNe+cGZAkOy oUvder62PEVngo= X-Received: by 2002:a05:7301:1692:b0:2b7:ee0e:e9ca with SMTP id 5a478bee46e88-2babc3e6243mr1608656eec.13.1771037574094; Fri, 13 Feb 2026 18:52:54 -0800 (PST) Received: from dtor-ws.sjc.corp.google.com ([2a00:79e0:2ebe:8:b713:5e7b:5963:d2ad]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2bacb543d4dsm638589eec.7.2026.02.13.18.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Feb 2026 18:52:53 -0800 (PST) From: Dmitry Torokhov To: Greg Kroah-Hartman , Danilo Krummrich Cc: "Rafael J. Wysocki" , Arnd Bergmann , Bartosz Golaszewski , Hans de Goede , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] driver core: platform: fix various formatting issues Date: Fri, 13 Feb 2026 18:52:45 -0800 Message-ID: <20260214025246.2095239-4-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.53.0.310.g728cabbaf7-goog In-Reply-To: <20260214025246.2095239-1-dmitry.torokhov@gmail.com> References: <20260214025246.2095239-1-dmitry.torokhov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Make checkpatch happy. This helps when checkpatch is set up as an automatic linter. Signed-off-by: Dmitry Torokhov Reviewed-by: Bartosz Golaszewski --- drivers/base/platform.c | 49 ++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index ec467ccd05b3..4617d1e88772 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -75,7 +75,7 @@ struct resource *platform_get_mem_or_io(struct platform_d= evice *dev, for (i =3D 0; i < dev->num_resources; i++) { struct resource *r =3D &dev->resource[i]; =20 - if ((resource_type(r) & (IORESOURCE_MEM|IORESOURCE_IO)) && num-- =3D=3D = 0) + if ((resource_type(r) & (IORESOURCE_MEM | IORESOURCE_IO)) && num-- =3D= =3D 0) return r; } return NULL; @@ -97,7 +97,7 @@ EXPORT_SYMBOL_GPL(platform_get_mem_or_io); */ void __iomem * devm_platform_get_and_ioremap_resource(struct platform_device *pdev, - unsigned int index, struct resource **res) + unsigned int index, struct resource **res) { struct resource *r; =20 @@ -172,7 +172,7 @@ static const struct cpumask *get_irq_affinity(struct pl= atform_device *dev, * @num: interrupt number index * @affinity: optional cpumask pointer to get the affinity of a per-cpu in= terrupt * - * Gets an interupt for a platform device. Device drivers should check the + * Gets an interrupt for a platform device. Device drivers should check the * return value for errors so as to not pass a negative integer value to * the request_irq() APIs. Optional affinity information is provided in the * affinity pointer if available, and NULL otherwise. @@ -844,8 +844,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister); * * Returns &struct platform_device pointer on success, or ERR_PTR() on err= or. */ -struct platform_device *platform_device_register_full( - const struct platform_device_info *pdevinfo) +struct platform_device *platform_device_register_full(const struct platfor= m_device_info *pdevinfo) { int ret; struct platform_device *pdev; @@ -868,13 +867,11 @@ struct platform_device *platform_device_register_full( pdev->dev.coherent_dma_mask =3D pdevinfo->dma_mask; } =20 - ret =3D platform_device_add_resources(pdev, - pdevinfo->res, pdevinfo->num_res); + ret =3D platform_device_add_resources(pdev, pdevinfo->res, pdevinfo->num_= res); if (ret) goto err; =20 - ret =3D platform_device_add_data(pdev, - pdevinfo->data, pdevinfo->size_data); + ret =3D platform_device_add_data(pdev, pdevinfo->data, pdevinfo->size_dat= a); if (ret) goto err; =20 @@ -906,8 +903,7 @@ EXPORT_SYMBOL_GPL(platform_device_register_full); * @drv: platform driver structure * @owner: owning module/driver */ -int __platform_driver_register(struct platform_driver *drv, - struct module *owner) +int __platform_driver_register(struct platform_driver *drv, struct module = *owner) { drv->driver.owner =3D owner; drv->driver.bus =3D &platform_bus_type; @@ -959,13 +955,14 @@ static int is_bound_to_driver(struct device *dev, voi= d *driver) * a negative error code and with the driver not registered. */ int __init_or_module __platform_driver_probe(struct platform_driver *drv, - int (*probe)(struct platform_device *), struct module *module) + int (*probe)(struct platform_device *), + struct module *module) { int retval; =20 if (drv->driver.probe_type =3D=3D PROBE_PREFER_ASYNCHRONOUS) { pr_err("%s: drivers registered with %s can not be probed asynchronously\= n", - drv->driver.name, __func__); + drv->driver.name, __func__); return -EINVAL; } =20 @@ -1021,11 +1018,11 @@ EXPORT_SYMBOL_GPL(__platform_driver_probe); * * Returns &struct platform_device pointer on success, or ERR_PTR() on err= or. */ -struct platform_device * __init_or_module __platform_create_bundle( - struct platform_driver *driver, - int (*probe)(struct platform_device *), - struct resource *res, unsigned int n_res, - const void *data, size_t size, struct module *module) +struct platform_device * __init_or_module +__platform_create_bundle(struct platform_driver *driver, + int (*probe)(struct platform_device *), + struct resource *res, unsigned int n_res, + const void *data, size_t size, struct module *module) { struct platform_device *pdev; int error; @@ -1124,9 +1121,8 @@ void platform_unregister_drivers(struct platform_driv= er * const *drivers, } EXPORT_SYMBOL_GPL(platform_unregister_drivers); =20 -static const struct platform_device_id *platform_match_id( - const struct platform_device_id *id, - struct platform_device *pdev) +static const struct platform_device_id * +platform_match_id(const struct platform_device_id *id, struct platform_dev= ice *pdev) { while (id->name[0]) { if (strcmp(pdev->name, id->name) =3D=3D 0) { @@ -1348,13 +1344,12 @@ static struct attribute *platform_dev_attrs[] =3D { NULL, }; =20 -static umode_t platform_dev_attrs_visible(struct kobject *kobj, struct att= ribute *a, - int n) +static umode_t platform_dev_attrs_visible(struct kobject *kobj, + struct attribute *a, int n) { struct device *dev =3D container_of(kobj, typeof(*dev), kobj); =20 - if (a =3D=3D &dev_attr_numa_node.attr && - dev_to_node(dev) =3D=3D NUMA_NO_NODE) + if (a =3D=3D &dev_attr_numa_node.attr && dev_to_node(dev) =3D=3D NUMA_NO_= NODE) return 0; =20 return a->mode; @@ -1366,7 +1361,6 @@ static const struct attribute_group platform_dev_grou= p =3D { }; __ATTRIBUTE_GROUPS(platform_dev); =20 - /** * platform_match - bind platform device to platform driver. * @dev: device. @@ -1419,8 +1413,7 @@ static int platform_uevent(const struct device *dev, = struct kobj_uevent_env *env if (rc !=3D -ENODEV) return rc; =20 - add_uevent_var(env, "MODALIAS=3D%s%s", PLATFORM_MODULE_PREFIX, - pdev->name); + add_uevent_var(env, "MODALIAS=3D%s%s", PLATFORM_MODULE_PREFIX, pdev->name= ); return 0; } =20 --=20 2.53.0.310.g728cabbaf7-goog