From patchwork Thu Feb 8 16:51:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 198481 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp302544dyd; Thu, 8 Feb 2024 08:51:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWPQM7QqrnqRMNqbNBgrtNYp/nNXxs7DPwyLOBjPmpKAlPjOiIpQ0+WjuMbgkXPQ+j5iQck8yq0G8w/KayFnNKmhcMF8A== X-Google-Smtp-Source: AGHT+IGFmuYqSMGVZORvSA4k5HoFgqE33ki/D9seJwtqTfoe4JRLi4rr+JDjHP/pVgdgw6ggeGAC X-Received: by 2002:a92:c087:0:b0:363:bc58:1ebd with SMTP id h7-20020a92c087000000b00363bc581ebdmr128328ile.10.1707411111570; Thu, 08 Feb 2024 08:51:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707411111; cv=pass; d=google.com; s=arc-20160816; b=yHF4ZVbJHuOkWrppSRdvfSbjiHdcfQl6HVPk5xIju1isEWJ20+I1bkkw5hcI+WmFBW rjIyEa7HYJ9lQ7WWLpt91d7+Stepxg4Se8Gr3WePd8ErEigP1Wr+Z0wEUU0gLp8txiNm NVfgAd7EwdoXOZtLcNJgFHplMzCTB3r/kCecxMcTraGhbHPXeVQo0YY2E1vOZXNmOuCo jvdG1zkMWlnXqNF2qWEYaLgIos+Qd25zfoOLtB3fGANZGqLr1n9N5ExFlcfyQoLZn3or hefQX9WiZUsvT94ydz652C+1ey7pNUSXoOTPTOS5I/jzruPIJoF57I8zU6XbVL2ydL1o y3Vg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=7eJWi6eNYuFYPK/LARry4zNJsatwYYOpsn8tijlRXkA=; fh=iIlAEZuzncVI6FcnSnw7rKLeAwJ9oX4i9CAvHzuri3w=; b=v1DvaaTNPAvJPCLq8u+qDpkJetT1XOLft9wRI0Bf5441YajR3LZix/uWDHvRa4WgR4 XPOf9GHefdJ8WdE7N3OFcaGLk4yhXLgQShEur+7ldxr2sLJXbeDhoZXwPIHU0FsyIXRO ZR2q7FmqGpCVtFUxJUEs4O4Rb10+OKcwbigMccobnCHThIa0sjrOHUN+q2HWmA2yvIMo guZNoyvzulUzUaRrw2GBjnzZFA6GZbv7UqhlnfDpOmYKT7j71N33VTW45WTxAcLGiuKU HLwEJ4kM1Ix3DGWvh7jN1ZfX1PxIwIKXfrGBQPMvm5yU5uKtauVzjU7ph3d4YEPMA2U3 q6GA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=xp6zcSk2; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58377-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58377-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCV4R56BijrTrvQxdV6dSU/umLsnHEBGSDIOkU3njWo4ClHFfPEYJzQLmaMzk6cWG0HaICR/xq4dQxZsSnypOx7bk6T6pw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e38-20020a635026000000b005ce6a86685bsi8605pgb.847.2024.02.08.08.51.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 08:51:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58377-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=xp6zcSk2; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58377-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58377-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 51B51281F55 for ; Thu, 8 Feb 2024 16:51:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0269C81AC6; Thu, 8 Feb 2024 16:51:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="xp6zcSk2" Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FDBF2033E; Thu, 8 Feb 2024 16:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.248 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411084; cv=none; b=pVdloxg7W3vsk9k9l11G2WQYp6+6kYBoNqyTXzIpDYpfTxZKLzNfVOGmGIbkAIB1on/iWTqCJBd0L86i6oNq3LY5lE2xM3bOEsd/weK0FjtdJGLwgDewcAx0pp6QsnaX7DW5kscyTCfojkOwiCmU8nWevI8ism7kLlW6ceG5Pbs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411084; c=relaxed/simple; bh=SzcvmT0u+d+mOegkatFJAAaI6odzW0ax7/YjwwvrAw4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=hKpZAalIwsefhQCA+SkC/fCcL/jhrhD/MYvI1Z832j8dnej9Dt/iBeTUwcOAmhO2r8vLzezp8NGOzszNN9hHxWZgt4ecRI2/Qfm0uIJtlKQAqntNXt28c/HeuE4f9NmGCuo+O0o3IOSYKdi97dPU3Mr4kLRP5+6L6AjUFKMo5Ic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=xp6zcSk2; arc=none smtp.client-ip=198.47.23.248 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 418GpGIe012008; Thu, 8 Feb 2024 10:51:16 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707411076; bh=7eJWi6eNYuFYPK/LARry4zNJsatwYYOpsn8tijlRXkA=; h=From:To:CC:Subject:Date; b=xp6zcSk287TfpQJP+nHMwWIh4Bv6U2ezCzrOkuJ7UZOpTzq49YQtgDct55SFYcdsO 0VbF8vVxkwcFbt3dPuYmsUh1YykJwLToTG+i5JoUFVxoVYm4fTQaLgV7WwaSHL6YGk uZO5asrzq/2jkriG7FMB7o1ELy8TG83XD5XL3s4E= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 418GpGfk041134 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Feb 2024 10:51:16 -0600 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 8 Feb 2024 10:51:16 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 8 Feb 2024 10:51:15 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 418GpFwC063394; Thu, 8 Feb 2024 10:51:15 -0600 From: Andrew Davis To: Bjorn Andersson , Baolin Wang CC: , , , Andrew Davis Subject: [PATCH v2 1/4] hwspinlock: omap: Remove unneeded check for OF node Date: Thu, 8 Feb 2024 10:51:11 -0600 Message-ID: <20240208165114.63148-1-afd@ti.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790350313595863033 X-GMAIL-MSGID: 1790350313595863033 We do not use the OF node anymore, nor does it matter how we got to probe, so remove the check for of_node. Signed-off-by: Andrew Davis --- drivers/hwspinlock/omap_hwspinlock.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c index a9fd9ca45f2a8..cca55143d24d4 100644 --- a/drivers/hwspinlock/omap_hwspinlock.c +++ b/drivers/hwspinlock/omap_hwspinlock.c @@ -74,7 +74,6 @@ static const struct hwspinlock_ops omap_hwspinlock_ops = { static int omap_hwspinlock_probe(struct platform_device *pdev) { - struct device_node *node = pdev->dev.of_node; struct hwspinlock_device *bank; struct hwspinlock *hwlock; void __iomem *io_base; @@ -82,9 +81,6 @@ static int omap_hwspinlock_probe(struct platform_device *pdev) /* Only a single hwspinlock block device is supported */ int base_id = 0; - if (!node) - return -ENODEV; - io_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(io_base)) return PTR_ERR(io_base); From patchwork Thu Feb 8 16:51:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 198492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp312990dyd; Thu, 8 Feb 2024 09:06:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVKM0jrIWXLJdv8EwRl/fiJxg69L7D3t+6SBZimRbVOeKX23eExd8NOrbHH8B+C9f1VMCjznAt2D2k1uO1NWtqdatSgXg== X-Google-Smtp-Source: AGHT+IELqVEMkly3SnDIzGe8NxY2MDvRR7r+3D1rrnCXKRcZxxmB9AomQatdrbspKlI9DjGyXHCt X-Received: by 2002:a17:902:ed04:b0:1d8:ee41:de89 with SMTP id b4-20020a170902ed0400b001d8ee41de89mr7047962pld.69.1707411983966; Thu, 08 Feb 2024 09:06:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707411983; cv=pass; d=google.com; s=arc-20160816; b=MqiQbeOXSKWQFY1MSFXEEn3trflR7ntHxq1YY+wuPC+Dk6fn1F6uziAqnl6pALXkAF zf/9q6cayvas4s+h0E9ifLbYONIO/vzhG/cpOk05Yx0QQx+zx3VI1pI9ZlGsnt4Ead/J NlI+JFIxuqC9Wocm+B4xn1ZqSbb70KDV0+TYS5y83Px+LNI84krPzx43LGF9d4Y95p9g snKmng91Y5NZRGRy4DjhQMVX4HDFMQDlRYmTr3Xl6Tf6ylblykc2SgJkSiAvaaJS4QME USBE8BBp1UfbO0v84YLSbRy0+Hcbn3i7Ufhp+2UVgeBoIWwI9K38PwtH3WS6nIpVwymf W/dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XgXkhbX2RXhlkR64jmiumGzBiNiAvpSx9IeblZh65dQ=; fh=2inIT5MYMK1SaM9rNgm2mqpea4c9wcTXM2VGtABhP04=; b=ioN5GueP7rGILqAMe1CbALefNI6JYg5MNPnq86fvsc8+Rz6BECLh4JQDjYGP3yyoja wZ8pgc72iAgva329DLRnMHhTCfC2FIb4vnhjeDH8xnhQMbC1mUSE32gD/9ZhePp4QFEb TgBt6S+6NDbFUZXZOzWUemAgxGtOHLK1v1aqQSLvsqLmhAInFhntOCckrh00V0R34TJU nPWz5LAvfj19l8Jeub0+NWJzMYTr2Gfwh0DUaEr58kkyIAfqO/qhE2KrtdEVT9bCXwAM rvm63h9duww9PbKIBSDuhc14DynMIAiiq6nVc8KJgf6VHmVUl3juo49SORjiW0mQpX5x YeHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=W94LrZvj; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58381-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58381-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCWKW5vj5RsQLL9ExTBgs2VlpKq0+7OQe29Eiyxk5nmkpn4g1LJwp80Knekn4ZKPG4sl53PRHDqZz7X0bjAKD77S/ydH9g== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t3-20020a170902e84300b001d9e1ab2acbsi34434plg.356.2024.02.08.09.06.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 09:06:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58381-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=W94LrZvj; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58381-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58381-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8BF91B2801D for ; Thu, 8 Feb 2024 16:52:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC6D87F7FC; Thu, 8 Feb 2024 16:51:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="W94LrZvj" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21F83823D4; Thu, 8 Feb 2024 16:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411091; cv=none; b=TjhXLwIikWIIOm32lTwbgGq5WqkvSklFdPHfeFBW7+2pnnKmtK+/M4bMPDH7woPZUuk3RB7dq8qNiZfDmVGR0CMDM2vtSKLwzEZ1xf1mmlmasZSUiSASi5gZYEL9sb+w51FEayV4RaWYyRIN+oYT3GCf9tDsD8EhYvQ5IZ/ol0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411091; c=relaxed/simple; bh=/bgoFQj8jLPHiXib2qrTtT2gzomVqVTRO7+L5T8TMP0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f5WcDMLZN4fIDxKBYhMtM4CrY5QlXJzfilb61jFDUqwHhHvauxlbfpSjBbbgWFVYDN4cjugMOwqrZbVdJLdoPb2Mby2Pjn0gjd+qt+Gh17OAQSGNeqtTQFaZZ1RQejhyNmJWmneGf+vQeTT7LAFJ/wDpQNJi7Ey6JfW9UnP0+kI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=W94LrZvj; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 418GpGZl048968; Thu, 8 Feb 2024 10:51:16 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707411076; bh=XgXkhbX2RXhlkR64jmiumGzBiNiAvpSx9IeblZh65dQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=W94LrZvjxTwSugcfGEB7lJIzvj3Bj+caEnV2WbbOxhPLfGdEoI4twDuwW+MfzkQTn aNo+xk/SxMNxvSH76Atll2dieR1/ByTTdamKH2ng0ip5mpdrqIKochZrOxoXeKOHUi ajxjXv5ATEo/riafph9Awy3GDxxI80btQc8hbzwQ= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 418GpGMv028648 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Feb 2024 10:51:16 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 8 Feb 2024 10:51:16 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 8 Feb 2024 10:51:16 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 418GpFwD063394; Thu, 8 Feb 2024 10:51:16 -0600 From: Andrew Davis To: Bjorn Andersson , Baolin Wang CC: , , , Andrew Davis Subject: [PATCH v2 2/4] hwspinlock: omap: Use devm_pm_runtime_enable() helper Date: Thu, 8 Feb 2024 10:51:12 -0600 Message-ID: <20240208165114.63148-2-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240208165114.63148-1-afd@ti.com> References: <20240208165114.63148-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790351228923240892 X-GMAIL-MSGID: 1790351228923240892 This disables runtime PM on module exit automatically for us, currently we manually disable runtime PM which can be error-prone if not done in the right order or missed in some exit path. This also allows us to simplify the probe exit path and remove callbacks. Do that here. While here, as we can now return right after registering our hwspinlock, simply return directly and remove the extra debug message. Signed-off-by: Andrew Davis --- Changes for v2: - Return directly from register as suggested on v1 - Clarify commit message drivers/hwspinlock/omap_hwspinlock.c | 33 +++++++--------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c index cca55143d24d4..3bd3ffab92100 100644 --- a/drivers/hwspinlock/omap_hwspinlock.c +++ b/drivers/hwspinlock/omap_hwspinlock.c @@ -89,10 +89,10 @@ static int omap_hwspinlock_probe(struct platform_device *pdev) * make sure the module is enabled and clocked before reading * the module SYSSTATUS register */ - pm_runtime_enable(&pdev->dev); + devm_pm_runtime_enable(&pdev->dev); ret = pm_runtime_resume_and_get(&pdev->dev); if (ret < 0) - goto runtime_err; + return ret; /* Determine number of locks */ i = readl(io_base + SYSSTATUS_OFFSET); @@ -104,41 +104,26 @@ static int omap_hwspinlock_probe(struct platform_device *pdev) */ ret = pm_runtime_put(&pdev->dev); if (ret < 0) - goto runtime_err; + return ret; /* one of the four lsb's must be set, and nothing else */ - if (hweight_long(i & 0xf) != 1 || i > 8) { - ret = -EINVAL; - goto runtime_err; - } + if (hweight_long(i & 0xf) != 1 || i > 8) + return -EINVAL; num_locks = i * 32; /* actual number of locks in this device */ bank = devm_kzalloc(&pdev->dev, struct_size(bank, lock, num_locks), GFP_KERNEL); - if (!bank) { - ret = -ENOMEM; - goto runtime_err; - } + if (!bank) + return -ENOMEM; platform_set_drvdata(pdev, bank); for (i = 0, hwlock = &bank->lock[0]; i < num_locks; i++, hwlock++) hwlock->priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i; - ret = hwspin_lock_register(bank, &pdev->dev, &omap_hwspinlock_ops, + return hwspin_lock_register(bank, &pdev->dev, &omap_hwspinlock_ops, base_id, num_locks); - if (ret) - goto runtime_err; - - dev_dbg(&pdev->dev, "Registered %d locks with HwSpinlock core\n", - num_locks); - - return 0; - -runtime_err: - pm_runtime_disable(&pdev->dev); - return ret; } static void omap_hwspinlock_remove(struct platform_device *pdev) @@ -151,8 +136,6 @@ static void omap_hwspinlock_remove(struct platform_device *pdev) dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); return; } - - pm_runtime_disable(&pdev->dev); } static const struct of_device_id omap_hwspinlock_of_match[] = { From patchwork Thu Feb 8 16:51:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 198483 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp302744dyd; Thu, 8 Feb 2024 08:52:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWTNepl7SkJgKSusN3u4FQ5pTaWceJoCTZLWo2kl/DNSVTrXJnf6iNfTolEjpUnDSA+U26Bogx4Wai4WvDJuLYfnvTStA== X-Google-Smtp-Source: AGHT+IGzqmTzAlCE2NaRvdPQHqYZ19wEZW10XhODFFKu5+ef6D8TPoyaaW1UDC+es35xkEbdwJjo X-Received: by 2002:a05:620a:1b81:b0:785:8b9b:fc47 with SMTP id dv1-20020a05620a1b8100b007858b9bfc47mr40687qkb.48.1707411129589; Thu, 08 Feb 2024 08:52:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707411129; cv=pass; d=google.com; s=arc-20160816; b=ReUhWeFkLSYcqc3lTP2PIr41siAYpaQR5VRrwlfbRsIMfm8ibdaq+G4G0DeQZVli1v BQakx4RXUcJorTlwKYeoW8erJnUSopSwhRyr8b9qCkUmu21aoMrsSjJwzJKHEd2iHf43 WXZG9mMjDxUBNnDYjfP/cZFV2doy2w0Awc3r+8/iZr+1pD61NUPqSk9KRVe55AaxIw+j jgE5sheSUzN9XkmvYyrjw5ndnjiLF3LkNT2UV+gKNADG2Tda1vjKFLv3sdX9fCI2jrRg g/ndwE5nqAZgRWk8r/ZQPgxrEdw5CF9Yd2xmPFHh0jRrXH9cTCJ5OUpJd8HS0dV+euYT uvnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=djSA4+7Ibdz7Va5HFpgHql2bnc9z2IocCEFA1yBcywI=; fh=yNEqaKPOE5bNwOXRw8mkwZJxmw1EXzWP6r/d1e33qY8=; b=Y/Kwy3vjfQwi1zqJ0t7DFs15B+kMUnY+bdLpfhYplAgx+Dfvy+Yf8ZMjvCdeNnX8Bj OjsDB0ff9dRn88St5b4ESv+XqvEBfKcw9I5t82cwXV4SEGY0Gx5tGd9pZoyA9uzK9OQ3 mwdXCvzmXmpiH37f9XEJRbzN3sW1y4k4vXhHmFYJ/WwC41h3miR8/eX57igSGejoWLh2 gRIcv977yvnE86/Qhe4eCu/3x/ang5p7TP26ACH6ydYmLlqeQA+0LU40wVmEOJyIxLT2 S0XAjT7XUaYI1TbRix1lTB/cYQeG8V7XvnJ7mkV2iDrJb2+PDY+I5q2ivW717IeZaA/v QTKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lHTrH5qw; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58379-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58379-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCUVqjyYv9vJEc4TjW1evczkuzIBkwbocOMHhf+1yKFKpCbGPGVRpB6o/TXOIeyxb9/imKuo1mgtNfXqltn0exW5MMd9JA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dt45-20020a05620a47ad00b007855175ffcbsi358575qkb.264.2024.02.08.08.52.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 08:52:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58379-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lHTrH5qw; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58379-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58379-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5E5EC1C21490 for ; Thu, 8 Feb 2024 16:52:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A196E823B4; Thu, 8 Feb 2024 16:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="lHTrH5qw" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D8917FBCA; Thu, 8 Feb 2024 16:51:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411086; cv=none; b=hRNSvB2xL3DFn2W4SkgUE5hIH+VqduV2VqeYqdigWCxXcfpljP3nq0ZqJ/PHcraNGCJba5zJG6wLTgFz6Fde60lvitXwR9jkoS3zIsq+7+JJWfuWrR0gIww5zg09Dm1G74px5yEzPWhxqC4pliPRrhQjAm2P5n5G5edEyZiE2Hk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411086; c=relaxed/simple; bh=tIaW3xLuqH8lm17q2qqTiYMsh2SjIZu10Kn5Jet9CqY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UHJmx8Q7r6i+4KMwBB9i+sFwzXEAx5snrTI/nmR+1BHi23NZbdUMhom9nOKCUnXf9b1aiaeMx51LGgSIIl2yij3vnX7pyjfDiGvSxqUVnM+3cfhZuB2kweWTvld+vCGn6B2SVe1+nCss2Y/i6e9+V29kncxd/OEcQUBkoZQg8VE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=lHTrH5qw; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 418GpGTA002555; Thu, 8 Feb 2024 10:51:16 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707411076; bh=djSA4+7Ibdz7Va5HFpgHql2bnc9z2IocCEFA1yBcywI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=lHTrH5qwf6zZcD9wa8FJDcRIJs39q2djIwnzu2/c+Z1iMyY9ez4a0jOE0uUyXHzcF ysUjAs8xwz/C1/Bs+NrlWbXnDmB96OH23gSI41T+bNcjVlW1NPSUcayjr3NV+J1XzX qz+3Jb4qCTPtQp+ikRgg4lOYbZD5UiSC9/Zgv2Qo= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 418GpGCC021887 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Feb 2024 10:51:16 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 8 Feb 2024 10:51:16 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 8 Feb 2024 10:51:16 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 418GpFwE063394; Thu, 8 Feb 2024 10:51:16 -0600 From: Andrew Davis To: Bjorn Andersson , Baolin Wang CC: , , , Andrew Davis Subject: [PATCH v2 3/4] hwspinlock: omap: Use devm_hwspin_lock_register() helper Date: Thu, 8 Feb 2024 10:51:13 -0600 Message-ID: <20240208165114.63148-3-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240208165114.63148-1-afd@ti.com> References: <20240208165114.63148-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790350332743232300 X-GMAIL-MSGID: 1790350332743232300 This will unregister the HW spinlock on module exit automatically for us, currently we manually unregister which can be error-prone if not done in the right order. This also allows us to remove the remove callback. Do that here. Signed-off-by: Andrew Davis --- Changes for v2: - Clarify commit message drivers/hwspinlock/omap_hwspinlock.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c index 3bd3ffab92100..fe73da80018b1 100644 --- a/drivers/hwspinlock/omap_hwspinlock.c +++ b/drivers/hwspinlock/omap_hwspinlock.c @@ -117,27 +117,13 @@ static int omap_hwspinlock_probe(struct platform_device *pdev) if (!bank) return -ENOMEM; - platform_set_drvdata(pdev, bank); - for (i = 0, hwlock = &bank->lock[0]; i < num_locks; i++, hwlock++) hwlock->priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i; - return hwspin_lock_register(bank, &pdev->dev, &omap_hwspinlock_ops, + return devm_hwspin_lock_register(&pdev->dev, bank, &omap_hwspinlock_ops, base_id, num_locks); } -static void omap_hwspinlock_remove(struct platform_device *pdev) -{ - struct hwspinlock_device *bank = platform_get_drvdata(pdev); - int ret; - - ret = hwspin_lock_unregister(bank); - if (ret) { - dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); - return; - } -} - static const struct of_device_id omap_hwspinlock_of_match[] = { { .compatible = "ti,omap4-hwspinlock", }, { .compatible = "ti,am64-hwspinlock", }, @@ -148,7 +134,6 @@ MODULE_DEVICE_TABLE(of, omap_hwspinlock_of_match); static struct platform_driver omap_hwspinlock_driver = { .probe = omap_hwspinlock_probe, - .remove_new = omap_hwspinlock_remove, .driver = { .name = "omap_hwspinlock", .of_match_table = omap_hwspinlock_of_match, From patchwork Thu Feb 8 16:51:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 198482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp302671dyd; Thu, 8 Feb 2024 08:52:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IENOwV5bYp+PHcikKijBKnrQZ+6aBfvOpmFr1t3M8bZpnRHsw/Bkkggrd2qylywFMkINSOa X-Received: by 2002:a17:906:fa95:b0:a38:65e6:b9a1 with SMTP id lt21-20020a170906fa9500b00a3865e6b9a1mr4293886ejb.63.1707411123133; Thu, 08 Feb 2024 08:52:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707411123; cv=pass; d=google.com; s=arc-20160816; b=AASvPJXJLHuVAmVsUCHTTM61HxCz4nJFDUcJbspZrfKzftRK1SR5OWVZLaXsMsufXd DQ+wn+2TU2ZXl6ChVqF95Zuw5etknRl9HAHhcyQNEwcpwaUz+SyhBLUbrcc2JwvzrztT GuC2RAo/6xYLnzW6Mp+ccvrp3yHdYnrQX+0KUB8Yu7LH0UvDZSMIuOWDPH7ymvMvYl+0 hRoruoiokw/CgeL5VvvjbvBSdqCsqnkdlBUC9YDq5MEW+fBLVh/RTKxoYEFNe/w+o+dX ghtvWV34Lf5Cr0pwHXStniWUNIJmoK+ghHeheOE2Ew0ZabnpF1DGaeYa8ESJntpRvyer z2Hg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xCGFMX89R1mGJW8/Y6A+fGzHuBoxs28i4x77PmX5znQ=; fh=og+y9KIBszbcrwkbZomH6HbMbaMxlCRSFYeaqgUi9Vs=; b=b8fd+FGvymvjPRxyPrFL0VHaAd+hUmevz38bp8niXIHZIXNxVEnaZwXtONi2ECOpAT XfF9SuPtX9k248A3up38En03u1ZOo5DozGCcqQ6lizzqmbeBfk2V1FctvLQ/J46Qm3F3 yOy8Xag86h+MKUVq2lsYW1kELCC793pUtu2hPhKRvjT5lCaAL1u30l29Q/pVfUuH1ZVY knYxrpgv6andvXiVSQNQN7dHcjQSAtdIJZc2uhTzVZZa+6PQf4w/3eeY9e+JQU8OYEEn YNLp/b1NIGoc/ygr5xey+NEd+VSrLxcAr85W7Y7w4j1v/9AlXPl5/W3Gg+KylGCIaLtX fPYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=D0Jgklj4; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58378-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58378-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com X-Forwarded-Encrypted: i=2; AJvYcCXrKidtcwRJ6z+nUqG7OOTi2VOrrXLLngTsUuMHIe9k0Xd/1ohGppnWlyfJhRPoGNPMAwg7CZ4jTbMzkGI90Jio2W0MQQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a19-20020a1709066d5300b00a3886cab926si193996ejt.605.2024.02.08.08.52.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 08:52:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58378-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=D0Jgklj4; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-58378-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58378-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2BEA81F21EEA for ; Thu, 8 Feb 2024 16:51:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2BBFA81AD4; Thu, 8 Feb 2024 16:51:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="D0Jgklj4" Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAE917EF16; Thu, 8 Feb 2024 16:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.248 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411084; cv=none; b=oe1y3spIXWknpdtkHwWifoI0fAdufHJdGdAk/Det7o4IBvDdb4AHTkBY/LoNMWvo4065phOE/sbDCf5cazKDZ48/RJ0Uo6MD/ghl8XCFsZKW67IGeP6cUwaGQsELXSMYoTLOCmjouOjGW0KeKJtQAmRDRYm3IxrvcjbIDC5r9Ik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707411084; c=relaxed/simple; bh=gjSKd6uTc8kBAKclYk3S89l34EyVOwSZa1YaZh1NZPA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HzbeScrRSExUH4EOt4hwqXKN+ozlqSSAjsYIg2PO9xnYHO8j77/KVClXFGMBksDEPUeW7nkynUwwN1mVoBGAT8Pe9M4ts3tk+sNqZ76RpQnPYXIz0k8Ae/M3QeE9CGqyf4oEPlqzWYBgVgfwcx1ZuXka9lDAQET9juXGmA+IJJ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=D0Jgklj4; arc=none smtp.client-ip=198.47.23.248 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 418GpHrd012029; Thu, 8 Feb 2024 10:51:17 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1707411077; bh=xCGFMX89R1mGJW8/Y6A+fGzHuBoxs28i4x77PmX5znQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=D0Jgklj4yGloL1h3M4KVZTz9AMrS/ihpMI4+HTJcBfZt7CB76YcKrqZ7tQw3Dp5gY WxdGg47uWuZ0f2yI65vcmgTqYIMKqmcKoEalqvp5fi6aDllMvP/cj+LbvOZ9rIXAac u3RcOTtbnMCRvipPJVzEJam/0OIifgxU2+a7nNBs= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 418GpHjQ041144 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Feb 2024 10:51:17 -0600 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 8 Feb 2024 10:51:17 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 8 Feb 2024 10:51:17 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 418GpFwF063394; Thu, 8 Feb 2024 10:51:16 -0600 From: Andrew Davis To: Bjorn Andersson , Baolin Wang CC: , , , Andrew Davis Subject: [PATCH v2 4/4] hwspinlock: omap: Use index to get hwspinlock pointer Date: Thu, 8 Feb 2024 10:51:14 -0600 Message-ID: <20240208165114.63148-4-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240208165114.63148-1-afd@ti.com> References: <20240208165114.63148-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790350325701358022 X-GMAIL-MSGID: 1790350325701358022 For loops with multiple initializers and increments are hard to read and reason about, simplify this by using the looping index to index into the hwspinlock array. Signed-off-by: Andrew Davis --- drivers/hwspinlock/omap_hwspinlock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c index fe73da80018b1..27b47b8623c09 100644 --- a/drivers/hwspinlock/omap_hwspinlock.c +++ b/drivers/hwspinlock/omap_hwspinlock.c @@ -75,7 +75,6 @@ static const struct hwspinlock_ops omap_hwspinlock_ops = { static int omap_hwspinlock_probe(struct platform_device *pdev) { struct hwspinlock_device *bank; - struct hwspinlock *hwlock; void __iomem *io_base; int num_locks, i, ret; /* Only a single hwspinlock block device is supported */ @@ -117,8 +116,8 @@ static int omap_hwspinlock_probe(struct platform_device *pdev) if (!bank) return -ENOMEM; - for (i = 0, hwlock = &bank->lock[0]; i < num_locks; i++, hwlock++) - hwlock->priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i; + for (i = 0; i < num_locks; i++) + bank->lock[i].priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i; return devm_hwspin_lock_register(&pdev->dev, bank, &omap_hwspinlock_ops, base_id, num_locks);