From patchwork Mon Mar 13 18:28:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 13173083 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 19307C74A4B for ; Mon, 13 Mar 2023 18:31:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231344AbjCMSbd (ORCPT ); Mon, 13 Mar 2023 14:31:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230493AbjCMSa6 (ORCPT ); Mon, 13 Mar 2023 14:30:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA68F84809; Mon, 13 Mar 2023 11:30:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E0306B811DD; Mon, 13 Mar 2023 18:29:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56053C4339B; Mon, 13 Mar 2023 18:29:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678732183; bh=eoKf67z0RJnZv79uQSS4O970nfxW9TSz1wAks4pBByU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A5pZkIFW5L4V/98zs6OBmVYuIlG1i6es/nQYVUrj0P/iA0qiRIoGKniahO790i2C0 ibG0+FXU9GeKK7FMeiwpsIyz7AVl9Rx5PuKYhWUYrQWYNveTcvvQhoAsfJeQgiwh2w PsBFyUCjVYJ7VplsjWB6FSh+rFDQ4nPoZW+6pPmk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: rafael@kernel.org, Greg Kroah-Hartman , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: [PATCH 16/36] sh: dma-sysfs: move to use bus_get_dev_root() Date: Mon, 13 Mar 2023 19:28:58 +0100 Message-Id: <20230313182918.1312597-16-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313182918.1312597-1-gregkh@linuxfoundation.org> References: <20230313182918.1312597-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1572; i=gregkh@linuxfoundation.org; h=from:subject; bh=eoKf67z0RJnZv79uQSS4O970nfxW9TSz1wAks4pBByU=; b=owGbwMvMwCRo6H6F97bub03G02pJDCn82RUr5qbG39X19HhySf2YgPJ/t03OPxNClzwy1S/Xa WhO6kvriGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIn8zmOYZx1QlT3lkf7i13dq n6S0JTTeSZ+oxTA/OMiUfd234PQVsRfPuGhWvrl8otkTAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Direct access to the struct bus_type dev_root pointer is going away soon so replace that with a call to bus_get_dev_root() instead, which is what it is there for. Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Acked-by: John Paul Adrian Glaubitz --- Note, this is a patch that is a prepatory cleanup as part of a larger series of patches that is working on resolving some old driver core design mistakes. It will build and apply cleanly on top of 6.3-rc2 on its own, but I'd prefer if I could take it through my driver-core tree so that the driver core changes can be taken through there for 6.4-rc1. arch/sh/drivers/dma/dma-sysfs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c index 8ef318150f84..431bc18f0a41 100644 --- a/arch/sh/drivers/dma/dma-sysfs.c +++ b/arch/sh/drivers/dma/dma-sysfs.c @@ -45,13 +45,19 @@ static DEVICE_ATTR(devices, S_IRUGO, dma_show_devices, NULL); static int __init dma_subsys_init(void) { + struct device *dev_root; int ret; ret = subsys_system_register(&dma_subsys, NULL); if (unlikely(ret)) return ret; - return device_create_file(dma_subsys.dev_root, &dev_attr_devices); + dev_root = bus_get_dev_root(&dma_subsys); + if (dev_root) { + ret = device_create_file(dev_root, &dev_attr_devices); + put_device(dev_root); + } + return ret; } postcore_initcall(dma_subsys_init); From patchwork Mon Mar 13 18:28:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 13173084 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 D5ADAC61DA4 for ; Mon, 13 Mar 2023 18:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231382AbjCMScE (ORCPT ); Mon, 13 Mar 2023 14:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbjCMSbb (ORCPT ); Mon, 13 Mar 2023 14:31:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A2582A94; Mon, 13 Mar 2023 11:30:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9CCABB811E3; Mon, 13 Mar 2023 18:29:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB9ABC433D2; Mon, 13 Mar 2023 18:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678732186; bh=BQ3qJWQ4zg4slNAg8mMque6OMF2Djl4oQD+H69jP9YY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NOUprOLhlkrlwRZlYiu/wusk/ux2b99AOfviPnKSf76GQ+8jEd73QVbTrjw/hspgt 4/VnagP02qN2iTAexDyC3Dfip+bob26aEJ47a2TyvbqJcwJu3DvHpnI3IHsN+7L7T0 nYFQqJV33hPBlZE6QD0wkfj2buWCA9/P06lYmIkA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: rafael@kernel.org, Greg Kroah-Hartman , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: [PATCH 17/36] sh: intc: move to use bus_get_dev_root() Date: Mon, 13 Mar 2023 19:28:59 +0100 Message-Id: <20230313182918.1312597-17-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313182918.1312597-1-gregkh@linuxfoundation.org> References: <20230313182918.1312597-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1515; i=gregkh@linuxfoundation.org; h=from:subject; bh=BQ3qJWQ4zg4slNAg8mMque6OMF2Djl4oQD+H69jP9YY=; b=owGbwMvMwCRo6H6F97bub03G02pJDCn82RWiLd1ftjeein5+RdZTqZ4vXOT8mUW3BDf4n/fa5 vauY09iRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkjDrDgrmXDFfe01psfmur 8OJyrscbWTMyLRgWNN8X4bb9MP25+R2T4CKV2SyczH5XAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Direct access to the struct bus_type dev_root pointer is going away soon so replace that with a call to bus_get_dev_root() instead, which is what it is there for. Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Acked-by: John Paul Adrian Glaubitz --- Note, this is a patch that is a prepatory cleanup as part of a larger series of patches that is working on resolving some old driver core design mistakes. It will build and apply cleanly on top of 6.3-rc2 on its own, but I'd prefer if I could take it through my driver-core tree so that the driver core changes can be taken through there for 6.4-rc1. drivers/sh/intc/userimask.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/sh/intc/userimask.c b/drivers/sh/intc/userimask.c index f9f043a3d90a..abe9091827cd 100644 --- a/drivers/sh/intc/userimask.c +++ b/drivers/sh/intc/userimask.c @@ -61,10 +61,18 @@ static DEVICE_ATTR(userimask, S_IRUSR | S_IWUSR, static int __init userimask_sysdev_init(void) { + struct device *dev_root; + int ret = 0; + if (unlikely(!uimask)) return -ENXIO; - return device_create_file(intc_subsys.dev_root, &dev_attr_userimask); + dev_root = bus_get_dev_root(&intc_subsys); + if (dev_root) { + ret = device_create_file(dev_root, &dev_attr_userimask); + put_device(dev_root); + } + return ret; } late_initcall(userimask_sysdev_init);