From patchwork Mon Jun 10 14:05:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1945897 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=iAUWpvfF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:40f1:3f00::1; helo=sy.mirrors.kernel.org; envelope-from=linux-gpio+bounces-7312-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [IPv6:2604:1380:40f1:3f00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VyYb96PfZz20KL for ; Tue, 11 Jun 2024 00:09:41 +1000 (AEST) 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 00793B25962 for ; Mon, 10 Jun 2024 14:08:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D81E984A4A; Mon, 10 Jun 2024 14:06:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="iAUWpvfF" X-Original-To: linux-gpio@vger.kernel.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 106978563F for ; Mon, 10 Jun 2024 14:05:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718028360; cv=none; b=sKD7ZReZY46Gph4H1MxfILuzqzX18cBHjsblv7+r0rdvTfL3GOSbDrqIMqle12sdz0ii9qqbG/MvhtJpVOw1oC5pCqy+LpwNoerCCo3BZ6UWmQs39h475VdEnyih0isFwXxZ9Hy1CyqVvVNQ2OLYwqicD9Y4sSEpTgvZ/xdKJKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718028360; c=relaxed/simple; bh=gBa1n5V5gUIsszcEppINk2D8zEynondAoO83jLEUfYo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rFgGQ7YCnKtFqg51p+5fHjeN7w+Fmj5zzPRn2Sccl/xIzSm7LYQG637kqvLFuBhJC3IaGBGi54afmD87UEgtyEUm4+MsEKp9qGXqnG4vqaYHhcUbpRsRv2Zwt8OzAlNEd7r5KpnkVA6gv8mzz0py/fGRWt/bg62rciXic/ihezI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=iAUWpvfF; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-421820fc26dso10699435e9.2 for ; Mon, 10 Jun 2024 07:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718028357; x=1718633157; 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=UIJouERmppUalE0J8gICZtjFJhQ1JN77/tIkUQ2LKPE=; b=iAUWpvfFP8nHFPCVQ7JhvU1uY6/D3fs44mT5ZiD4pMoIOUoaeWb1M0TenuTmG0Yntr vahd7Vsg6xInQlsppro9iPWerE0eWW25RAH8kA/Hg//hneooVGSMEPM5+Xwkn3Yk3U+9 4xZJ5vVvpwhPwqofo4yt5QHlf2/W8AXFaWw3u3X3WKGMdqU7EEexnYKAnqw4tn1YoQPX t2VWOZs2au6oPVeXjOdgAyrphv/R20qFa/MWMUqJK+4Uj5Yxi0kVaz93bf98he8umI/v yYOo5fqN9cD3UFaJxUL23ydE48rhQV4n8ghPJP18TvBxSCsbW7iKKRXDorPnLsugI472 eg1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718028357; x=1718633157; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UIJouERmppUalE0J8gICZtjFJhQ1JN77/tIkUQ2LKPE=; b=pTDAyKsxSwLkHIlZRImwDIBhrA24HvPjZzLp4SL/fuDNno3NSOhQWQSMpx0z3+NJfp 6XjAUKSSMj+EbX1mR3321csrUHYLZc3ZM2LAMJdasUQZlq0PI6VDQmeRQg1YHKMwQxcE IlASXteE4Jk1YFel8l35H1HcuNpMI80Hx6sqlvCeWtgWyXhRi3mUiF/SYtOkuKg2ZQ2e Ql0O9tAuIe2/hq5zEPzjmhYx9QH16ERKsKyY95Ltpyrs4nIjkH5hos0ABNvvU4IwsiBl MGUwETZA160lG5Obvyc+3DA/7/FNruFAECnY8h7MON0NKPEuciaJf7zscfyAuagjuNiW W1ow== X-Gm-Message-State: AOJu0YxJSDPYPf1kA2XrF9tBrXwlAnD7yjvDJQNOMopOpYpSz4DP5DrW jWyZUbVzAaD1NjnMdJYWCrX5o5Xrk2kAioNOpdwgopi0EI7SN5Shvv73MSbw4EY= X-Google-Smtp-Source: AGHT+IHrdDDcymVE+Z/TLFKqIfkJKC8mz7mWvdmD88Fhip4ejOwb6y4gpPMrE5VZu6d8G7l6TDSCsg== X-Received: by 2002:a05:600c:a42:b0:41d:d406:9416 with SMTP id 5b1f17b1804b1-42164a4ddd2mr81776455e9.34.1718028357271; Mon, 10 Jun 2024 07:05:57 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:75a:e000:b790:b49b:9038:8e99]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42217ff4302sm11113845e9.31.2024.06.10.07.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 07:05:56 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Andy Shevchenko Subject: [PATCH 1/3] gpio: sim: use device_match_name() instead of strcmp(dev_name(... Date: Mon, 10 Jun 2024 16:05:46 +0200 Message-ID: <20240610140548.35358-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240610140548.35358-1-brgl@bgdev.pl> References: <20240610140548.35358-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski Use the dedicated helper for comparing device names against strings. While at it: reshuffle the code a bit for less indentation. Suggested-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-sim.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index 2ed5cbe7c8a8..278bb0c54636 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -581,19 +581,19 @@ static int gpio_sim_bus_notifier_call(struct notifier_block *nb, snprintf(devname, sizeof(devname), "gpio-sim.%u", simdev->id); - if (strcmp(dev_name(dev), devname) == 0) { - if (action == BUS_NOTIFY_BOUND_DRIVER) - simdev->driver_bound = true; - else if (action == BUS_NOTIFY_DRIVER_NOT_BOUND) - simdev->driver_bound = false; - else - return NOTIFY_DONE; + if (!device_match_name(dev, devname)) + return NOTIFY_DONE; - complete(&simdev->probe_completion); - return NOTIFY_OK; - } + if (action == BUS_NOTIFY_BOUND_DRIVER) + simdev->driver_bound = true; + else if (action == BUS_NOTIFY_DRIVER_NOT_BOUND) + simdev->driver_bound = false; + else + return NOTIFY_DONE; - return NOTIFY_DONE; + complete(&simdev->probe_completion); + + return NOTIFY_OK; } static struct gpio_sim_device *to_gpio_sim_device(struct config_item *item) From patchwork Mon Jun 10 14:05:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1945894 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=0oaAQD0e; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=139.178.88.99; helo=sv.mirrors.kernel.org; envelope-from=linux-gpio+bounces-7313-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VyYZQ20Vfz20KL for ; Tue, 11 Jun 2024 00:09:02 +1000 (AEST) 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 9978828D1D3 for ; Mon, 10 Jun 2024 14:08:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C5A513DBA2; Mon, 10 Jun 2024 14:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="0oaAQD0e" X-Original-To: linux-gpio@vger.kernel.org Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 DC383139579 for ; Mon, 10 Jun 2024 14:05:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718028361; cv=none; b=aB8tifvSLeexD/+mykFHbRiSeKiMH0nzPU3AZdFOQXXm53sWPtIlb4zS7mDT59/VTB8+CZ9QZGyZ9h9V2bVsRkLTkZAn0MJbjYqymE/vzp98B70cbCdH1nCmBSFaU4nC1Mqh9tOG+CMO/h/DvX6+zVqdwfVv+7kn1Ow8CqAEMtk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718028361; c=relaxed/simple; bh=lAjgY8dLuGdGC6Fq7V7WChrbFC9MFhsTo0rHF9YQN0Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jeYhfIxqLF/yjXbT4P6KFBZM8sJegGwLcwys7obe3UKEbRpEkVx4Fyt7Eh3tOTXwfluXHCeu3Zt/A5cJQKKBipjotoQIN3JnmmmAL7BVaTNr11F9u1y4qtIMuOfIc98EMppYTpmdn7NyfBgcMbl/tLZbO4V5ptj3RKQUI2GPo5Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=0oaAQD0e; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4218314a6c7so10038345e9.0 for ; Mon, 10 Jun 2024 07:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718028358; x=1718633158; 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=tVPCkYxQUdy/Awp1hNg9f0j2vh3RYT3ZP4TiIfwhU08=; b=0oaAQD0eFm2O7LnRHGPb2u9UP93GavrJIzEEEPv9bzPI+V0AWIfBfulSdSWR5QO4ae FUyt3BZrp+j1w9M+AZJc0AkZkjli6lhcDVPW0quMj8r/bARCnM3+VSFRfKGCbGQIu2lC FAi5aHiMO7ox9c5WAhBf8BsRvvA71LJXron23d8Q8hyp0QloDG2GW2fRTjsah5Mfon3B U4ACjiwZMeO/xWFsiRyxAvJIp3Elxw8tlt9+XfBKsO0YT9iPWREuBTvoxXgq70IBUQWq iLVeVEsCbeZR8RFh99g+wmCm/9djs2zFZw0rVRC1alfJjLMXMYc2kziest0U3cZXF+jE QANw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718028358; x=1718633158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tVPCkYxQUdy/Awp1hNg9f0j2vh3RYT3ZP4TiIfwhU08=; b=Yi2B6PYR7Fn3c41QnzDEIxZ0uqgU50ak1C5jyt9TcsKpUvLP9AOTj/TsyCmOgG6Yh4 xn0szJd+yOmDGDXAYiMJZQFtp5YXeS/+BwGIDThnNlwp4mH0i7qo6kbyaTgl+cJXJAmr CSrJ7eCZb6kH01isTAiQhj8SrEFG0hwMt3ldgXVJZu8/F9EHzsaSrwmC3Lk16MMufitt NBmCIabnoLtVGmWpq7Qlz6+8zi5iPuyccGZl2IqjvChHCa7a4rVy1dzzGoOy4YkGwnFP tEiOUtPFOgXXFG1Ft1eBq366/h8Jb/QBb5LrFk1kdO33LKxVE38BGE4qjVPYPIoaOwdh 8rXQ== X-Gm-Message-State: AOJu0YzJHPT3JvW/TPK+aSwfLG5wbWsUgMcuNlM2TexICRjzayiYgumX olYu6RMdDq+f/6o1dOQiwB6n1BdeFt10e29N4rpAO2RQsY6+GgnWrKk5to4MHG0= X-Google-Smtp-Source: AGHT+IHD7s8aUeZFgQSwLCIb0ucUJW0RSs7ARnvz7bG/avi15niU4ozU0w+/RzMjvzMj2Z/DM2dJKA== X-Received: by 2002:a05:600c:19d3:b0:421:1165:f240 with SMTP id 5b1f17b1804b1-42164a368fcmr80385025e9.36.1718028358448; Mon, 10 Jun 2024 07:05:58 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:75a:e000:b790:b49b:9038:8e99]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42217ff4302sm11113845e9.31.2024.06.10.07.05.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 07:05:57 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Andy Shevchenko Subject: [PATCH 2/3] gpio: sim: drop kernel.h include Date: Mon, 10 Jun 2024 16:05:47 +0200 Message-ID: <20240610140548.35358-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240610140548.35358-1-brgl@bgdev.pl> References: <20240610140548.35358-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski We included kernel.h for ARRAY_SIZE() which has since been moved into its own header. Use it instead. Suggested-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index 278bb0c54636..21ad8d87ef04 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -7,6 +7,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -20,7 +21,6 @@ #include #include #include -#include #include #include #include From patchwork Mon Jun 10 14:05:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 1945896 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=FCc1mBmV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=linux-gpio+bounces-7314-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VyYZl11hJz20KL for ; Tue, 11 Jun 2024 00:09:19 +1000 (AEST) 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 703D71C21E47 for ; Mon, 10 Jun 2024 14:09:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D963B1422D9; Mon, 10 Jun 2024 14:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="FCc1mBmV" X-Original-To: linux-gpio@vger.kernel.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 1D54D13C676 for ; Mon, 10 Jun 2024 14:06:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718028362; cv=none; b=eh+DovFb3Lr0DxSJTA9Qz+6A46udWppBInRt2JGdCm2hhnBGRle3Aqp0L/8/bLrRD2Tk2sZ7TTneCQoEVgX22pqhv9pHRffxTzevqentlu5SqKrY2ddwXaLVrQPvhY35vMmRkLzp7jfrX6DV3jDWGLHLvkxwecZtWenWNacxxnk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718028362; c=relaxed/simple; bh=kOfJiJzAPqwv+oYlxLi+l9Q00ckfBULXh2ejLluKr9k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k5rI2/UeEiZeDHLUcaPKyA5VJzYlTiaLf0+3BNAVuDMVakHcoPC+6PQhNzz222nUN/PFUudJg0Ak5l9dJ0ZKwyJuV9BxhYVR+tIJcXtfisykMZPfrSfv8aeKGzVUoDgrEvHv6W3zjPvW2hqYlFfOnoix8apMgUZHNKbDRs5/kXY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=FCc1mBmV; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so27202025e9.1 for ; Mon, 10 Jun 2024 07:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718028359; x=1718633159; 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=KDBlyzU3LCghlnbJD04v7eaIgbQL2VqdEI9XHpUZT+E=; b=FCc1mBmVVlBuEjXjCvPmFrOmv+TvvHlyCmW1Ztmo8Gf0mtgf46pOHWbhcQ8Glli6vu babbiRCc7VF1OCBF+Ooovvtg4F4spAaYB6ph7VGAy31/mvwWUYhnvEyjzTlbLfP/b/JQ PKsIeaaP+ZNDaOeT/8Ms4g99UVr10GYRaEdat2n4DCLS7D91A+jpcywEoBNVz2VrW8l0 SY8p/OzpS6BC5ta1lg3MEMCYlPFm3FLL/fx65OfyZbphByho6sEYDWqoh1CXssOmNi0m erm4CqZs1bgJE0TsErN5ZGUhV5tLun0FQTTVBnearZukcmH4sP3J1GwXDxli/OnAliBx qONg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718028359; x=1718633159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KDBlyzU3LCghlnbJD04v7eaIgbQL2VqdEI9XHpUZT+E=; b=oenit0EN2zW73wCqmKc7pUqEURtyQhN2vdAruVOKiEERTTxLp0iHFo6E5Fe/ttOQ/G +vNT1FhHwgONC+tSndW+uBTo0Vi4dpXF37IdzBuDGci1Y9NEhEhm6KSXiAflaHb+6eUl PR6yF8jj1n0yVZnTrCtn6QjkyyB34meUIf/0tG99KigTIU8p/QpBoUdnkrnRWvQC2K6G efmGOArFYKGuEDXr0qlzmoWK/z0ezX9E4sDBWEvNPel1l09Vk6yUmOKFu+MzRWrGlwwZ UuBOOShM/M6lD1TGx9I+z15yx7qYIDNi1T88fnEq+jw4NkZzV5vJ7RDhtuOFb4r9KbA+ WZsA== X-Gm-Message-State: AOJu0YwdzovtQqwYql6Aepfuf1jVY76/EUTsPZ1FWMSpVFW2jgAvE9vE xkQGIj5I2AqoHS/1KJmIzfoxeP3ShrtZueTcJtt/80KsrPRJiaaWc6HIuUFbAz8= X-Google-Smtp-Source: AGHT+IH498v3qN4pefMCAJ4sGaSW3frxsUeK5QkpDqIebe9cE6y0eeKYz7AcVrvfZkyrqcfS4rQMVQ== X-Received: by 2002:a05:600c:358f:b0:422:1446:378 with SMTP id 5b1f17b1804b1-422144606f0mr14376975e9.2.1718028359560; Mon, 10 Jun 2024 07:05:59 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:75a:e000:b790:b49b:9038:8e99]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42217ff4302sm11113845e9.31.2024.06.10.07.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 07:05:58 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Andy Shevchenko Subject: [PATCH 3/3] gpio: sim: use devm_mutex_init() Date: Mon, 10 Jun 2024 16:05:48 +0200 Message-ID: <20240610140548.35358-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240610140548.35358-1-brgl@bgdev.pl> References: <20240610140548.35358-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski Drop the hand-coded devres action callback for destroying the mutex in favor of devm_mutex_init(). Suggested-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- drivers/gpio/gpio-sim.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index 21ad8d87ef04..4157735ea791 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -308,13 +308,6 @@ static ssize_t gpio_sim_sysfs_pull_store(struct device *dev, return len; } -static void gpio_sim_mutex_destroy(void *data) -{ - struct mutex *lock = data; - - mutex_destroy(lock); -} - static void gpio_sim_put_device(void *data) { struct device *dev = data; @@ -458,9 +451,7 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev) if (ret) return ret; - mutex_init(&chip->lock); - ret = devm_add_action_or_reset(dev, gpio_sim_mutex_destroy, - &chip->lock); + ret = devm_mutex_init(dev, &chip->lock); if (ret) return ret;