Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp657510lqp; Sun, 9 Jun 2024 13:06:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbFDWL1EzICd1TGUAhmhQXdczLoQqKA8HUMr/Z89+HCgmwK87uSkKZHITq7VO1iGCmK7jWSyYIbeBomVari1/n+kbUuF0iqwPEOguM9w== X-Google-Smtp-Source: AGHT+IEq6d4Aol3wGURbkmJHcy4dfeLA6dbdLeNuuFoleDU8ywAPOnhB2HD5heTCyCVSQwowHexd X-Received: by 2002:a05:6512:36ce:b0:52c:5f12:c6ba with SMTP id 2adb3069b0e04-52c5f12da0cmr2242876e87.37.1717963607651; Sun, 09 Jun 2024 13:06:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717963607; cv=pass; d=google.com; s=arc-20160816; b=SOnMdj1Gj1ELvubRVYEnrjG+CaLe3T/U9CdFjxO1cnki+Uvo24MCJzlKnxGisOJGfW bJwRR/hMwvLT6uvmbhyscG51ebLq/foObSWearXGTZGENvZ8cP3rvIOLszbR6xi1CogV zmvC4TYkhOTC+3Fvk0zKkQhgF5QB7YFqrUcMeFXTl/BoN4/jQQN6VR2lo98sZp508rwb 5GG5cEhSBfH50nb25xs6oYFOVB8cFGMSMjFYhfpUdlqVDEUiqCBRfj9gnAD+yAVrwdct GPGsyZVORo9gbAfon50Y5y01103CzRa3CGe+t3yXHzp3pDjB1jhej1/HvL4O+yOOfz6J mBYw== 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=oYKfigbf7VqwLqv7HhequLfARQ4HkFaCIDWgcDYu/E0=; fh=FJ8x7DPV/QyeQzCuecLXFQrjlcIJJbKy8FWB8FiClNo=; b=0SRYVooUFRiCFjVjQkYhJ+qHF/A2NHbJzt7RlCaIptQwl+Kl6vXld+38x8IO9bNQY9 7TThIR62GH9hGbZsRMeYuciot9xcWxnDNAXrHJu1pIUc4x7/PYVGwxgus1nm+/qHPPzh 1GyMD3U+ZAOdE5GBfc2K5OPek8+mCYbOw+aLnaGYbDGiurJ+WfjTIiqw3oW+McMR8FRt Dn8IRl0XZdPymqzKKQlohVsExjxNTNFCbZ83usxNGAHOuANK0IM0XxaieSYs37ENn1SI q12Z+1RuEz/wOiEWK3BsBETFYXR8NL95q3uKetSRJqvSbxz9yyQ1xVBNpjxnzPIYFjWh kqug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=HqZsCIor; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-207498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207498-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae28df75si3907313a12.651.2024.06.09.13.06.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 13:06:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207498-linux.lists.archive=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=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=HqZsCIor; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-207498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207498-linux.lists.archive=gmail.com@vger.kernel.org" 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 336AF1F212FB for ; Sun, 9 Jun 2024 20:06:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 272444D8DF; Sun, 9 Jun 2024 20:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="HqZsCIor" Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) (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 8F0BE43AC4 for ; Sun, 9 Jun 2024 20:06:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717963587; cv=none; b=o0a5EStuHAZfW2MvgbaTWPwJ3rN+kseFee1Fc+32QChx2sYYGFmidhN8uO27fNVo7/Q3DVjvfUZghydlxQuBdh8rNMCz/aKIGzbUthwt/U0QR5fhOF6emtkYOuixBBIBPdWJfvvqJ3QtfZJv84rxvHJqtnBnmFfQt6fKn33ibmY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717963587; c=relaxed/simple; bh=OQ8LIfPXu3hLpWk0qkAUgzkjoCV+/oOpWmGnaf7E7Qg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IIFixqTocXGUl/aFyGE8t+YvP30BpelFlfZIjvM1XgTPBVd3InF0TIjmzQe6Rg4crTfj4CoZgnAf8ZEBS6Ov5WwiWTFXRueHgALc6SqtlkIo3w2ELZoHereqVvhJyEASAxWWsNO5kGqlgwdmnEewQp3nD3frZ4EEF4g80o7mNsc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=HqZsCIor; arc=none smtp.client-ip=209.85.161.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-5b2e93fddafso1727748eaf.0 for ; Sun, 09 Jun 2024 13:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1717963585; x=1718568385; 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=oYKfigbf7VqwLqv7HhequLfARQ4HkFaCIDWgcDYu/E0=; b=HqZsCIorJSHZPBcperrXtXGBWuE5zcItFcIVv75hX2mX7RI7J6CBmzbBT3LxDTaIws 9cCLU9M9TOuwS+BV3ClUJ+uYytaBn9lmddcuH6PabcyKAL54c5E19BVgzxGRDscDKdEd XTHWW1EjSSfwOfiHU1Y2iQGFLANNtklEUgHR3jAN+dWZFwzbnp0/olL8EZSluEf2YjnC F0Fd4BQPAqnpofSVorYa+5b5NVDbCLbmJGknjC4HLOhB/2jrE2cE9kj6Dq3qhnKGQrb4 Q7P8eppPIkV/e/3d0ernZ7CW+QU88pm+WmJWARXcQHIs7RxhPv68q+4V7glPsthHshGF 6Vvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717963585; x=1718568385; 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=oYKfigbf7VqwLqv7HhequLfARQ4HkFaCIDWgcDYu/E0=; b=TtV8Bag8DpoqcgKx81krxRSSyzszjp8YuhPVQDrxrya8gg0U4PUC+dMsy5fpnuoYrI ozEqc1faUe9VE8nLLLusQkNj9IIPmUyHr60TtOQ7zLciUpqKs4wzxWWFNlnWE/Xwvp8r TCypvmlHE5vwDK+0JS3/Z3Luxg8lTFDBKeWGhiqZy5RW9t7lb1jvBciukWfONeKwrOvT ZXhj7Omkf7QNir6lHE9dgFWft7sKRsy04XblM9iZmzvj7xNIP3/OTrpxflugRgVFq1pN z768rIHcLvMbuS9QXIJRB/skMQ1Q4T8/6hPsBVOHUSW3kC/4xayrpbq+9amtKFGI25s7 1cWA== X-Forwarded-Encrypted: i=1; AJvYcCWWu/LDKEe0DKV7Qtxamkb+2lFf5cNs4hdOUnDPaEKSiBlO2i0q8dZMQ5b/hLV6QmK8CoWn4FfEM+j7fSErXz7NS031bEO0ip6y9twu X-Gm-Message-State: AOJu0Yw4zEKH91eJdlgYKjNiNqKgQySTpYSAzJMVUUCkMBicH+KutNr9 rqi213saJ/5IpjYpzVb7a35vLXWsdw2Gr7R0x3uAXNY0gIUKEOiuXnsUP6jqBNM= X-Received: by 2002:a4a:bc01:0:b0:5ba:8ac1:3a29 with SMTP id 006d021491bc7-5ba9151ae64mr4996042eaf.1.1717963584573; Sun, 09 Jun 2024 13:06:24 -0700 (PDT) Received: from freyr.lechnology.com (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5ba977e121bsm1413278eaf.28.2024.06.09.13.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 13:06:24 -0700 (PDT) From: David Lechner To: William Breathitt Gray Cc: David Lechner , Judith Mendez , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] counter: ti-eqep: remove counter_priv() wrapper Date: Sun, 9 Jun 2024 15:06:16 -0500 Message-ID: <20240609-ti-eqep-cleanup-v1-2-9d67939c763a@baylibre.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240609-ti-eqep-cleanup-v1-0-9d67939c763a@baylibre.com> References: <20240609-ti-eqep-cleanup-v1-0-9d67939c763a@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: b4 0.12.4 Content-Transfer-Encoding: 8bit The ti_eqep_count_from_counter() function is just a wrapper around counter_priv(). counter_priv() can be used directly, so we don't need the wrapper function. Remove it. Signed-off-by: David Lechner --- drivers/counter/ti-eqep.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c index 30c35b6c6050..924e379303dd 100644 --- a/drivers/counter/ti-eqep.c +++ b/drivers/counter/ti-eqep.c @@ -86,15 +86,10 @@ struct ti_eqep_cnt { struct regmap *regmap16; }; -static struct ti_eqep_cnt *ti_eqep_count_from_counter(struct counter_device *counter) -{ - return counter_priv(counter); -} - static int ti_eqep_count_read(struct counter_device *counter, struct counter_count *count, u64 *val) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); u32 cnt; regmap_read(priv->regmap32, QPOSCNT, &cnt); @@ -106,7 +101,7 @@ static int ti_eqep_count_read(struct counter_device *counter, static int ti_eqep_count_write(struct counter_device *counter, struct counter_count *count, u64 val) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); u32 max; regmap_read(priv->regmap32, QPOSMAX, &max); @@ -120,7 +115,7 @@ static int ti_eqep_function_read(struct counter_device *counter, struct counter_count *count, enum counter_function *function) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); u32 qdecctl; regmap_read(priv->regmap16, QDECCTL, &qdecctl); @@ -147,7 +142,7 @@ static int ti_eqep_function_write(struct counter_device *counter, struct counter_count *count, enum counter_function function) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); enum ti_eqep_count_func qsrc; switch (function) { @@ -177,7 +172,7 @@ static int ti_eqep_action_read(struct counter_device *counter, struct counter_synapse *synapse, enum counter_synapse_action *action) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); enum counter_function function; u32 qdecctl; int err; @@ -249,7 +244,7 @@ static int ti_eqep_position_ceiling_read(struct counter_device *counter, struct counter_count *count, u64 *ceiling) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); u32 qposmax; regmap_read(priv->regmap32, QPOSMAX, &qposmax); @@ -263,7 +258,7 @@ static int ti_eqep_position_ceiling_write(struct counter_device *counter, struct counter_count *count, u64 ceiling) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); if (ceiling != (u32)ceiling) return -ERANGE; @@ -276,7 +271,7 @@ static int ti_eqep_position_ceiling_write(struct counter_device *counter, static int ti_eqep_position_enable_read(struct counter_device *counter, struct counter_count *count, u8 *enable) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); u32 qepctl; regmap_read(priv->regmap16, QEPCTL, &qepctl); @@ -289,7 +284,7 @@ static int ti_eqep_position_enable_read(struct counter_device *counter, static int ti_eqep_position_enable_write(struct counter_device *counter, struct counter_count *count, u8 enable) { - struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); + struct ti_eqep_cnt *priv = counter_priv(counter); regmap_write_bits(priv->regmap16, QEPCTL, QEPCTL_PHEN, enable ? -1 : 0); -- 2.45.2