From patchwork Wed Apr 26 08:08:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13224216 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 5D1E8C77B78 for ; Wed, 26 Apr 2023 08:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240009AbjDZIIT (ORCPT ); Wed, 26 Apr 2023 04:08:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239966AbjDZIIR (ORCPT ); Wed, 26 Apr 2023 04:08:17 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F6F41FE5; Wed, 26 Apr 2023 01:08:07 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2a7af0cb2e6so65408281fa.0; Wed, 26 Apr 2023 01:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682496484; x=1685088484; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=LWFogPesRkVpMzxNVC02NFFYCke98s78XYIUivPMFsQ=; b=OrDhF11kmo13l3Tx4eN2FjmD1eybCrYJ0Pd1hjZsrNss07E3DoTOnNIO4+ZGQvomvA hTmR8HNw+7RTcjDPOThbvyUYp5GtQJ46kJ6o6d/6Gj1vsC5ny4whzsA6K/qzt8QgCx5A ZbrTrx2X0iPrT3oCncu7OYFN3saasFqoJ/xZUyJhbOxyVGMR2swJUVq5IEmRDX361jVC wbw05qPcF25yZC00xkeN/1r/gcOGT839LUdJPUGRJFKUcsAibmYCnma3o2/0s7dieHoL QTeKaWimdX73IGD03qNBJ2EGDLfLYm0MlriQESqnyahhD/zOM3TXfLJu3/8rOvkShhBP QFng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682496484; x=1685088484; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LWFogPesRkVpMzxNVC02NFFYCke98s78XYIUivPMFsQ=; b=B3Ci1eoJWsqSqeGaUVbUpXHHD7sEdyfNtkApTjfRSQP6JhDas3IszFFRdQFdYsVERr 9HgyuD/6ezmtzrlwNZ9/aLzCEogX8EjOjN3R/X5mPrWT7avWPaufZJP+QqCMijU1KwgQ Aa8P71jrdSaezY23Czz+noyCs+cvrfM3T8cCrVFTUkJ9P4+Lnp2yKWtTdSZ/eqfhSS8I V6LbJLM/e6JSZiMeUOgv1hWUfTnA7HE9gp3/DjRlhU+Ats1+ZfQsyNisLArGtkG4IAEa lrW3+KQZp/nXFnWz6oRQBkc3j9/VdN9nzlMHXKKSbzRGv3p2vThjvPezqSah85X0Nayq 5z/A== X-Gm-Message-State: AAQBX9eF9WxNw1bAwwPEIaciC5rFoLWJdkeU4Cx9QMQX3bykf5bHx4oN NryX1t3Um4b+KUEsw/ei/pw= X-Google-Smtp-Source: AKy350aGmzbOtkw8gzRpYFQIYuuLon7uAey2DlB3ct09oD1GSuh6fOoqQzXFssTODba71G3SwH4DmA== X-Received: by 2002:a2e:8602:0:b0:2a8:c7f8:58ef with SMTP id a2-20020a2e8602000000b002a8c7f858efmr4118783lji.22.1682496484476; Wed, 26 Apr 2023 01:08:04 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id g6-20020ac25386000000b004edb2cb3500sm2333035lfh.279.2023.04.26.01.08.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 01:08:03 -0700 (PDT) Date: Wed, 26 Apr 2023 11:08:00 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Matti Vaittinen , Andy Shevchenko , Shreeya Patel , Zhigang Shi , Paul Gazzillo , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti Subject: [PATCH v3 3/5] iio: kx022a: Use new iio_validate_own_trigger() Message-ID: <6c1081343f8fa1fe8bb21f340ba031f61d3b6085.1682495921.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The new generic iio_validate_own_trigger() can be used as validate_trigger callback for verifying the used trigger belongs to same device as the iio_dev. Use the generic function instead of rolling own one. Signed-off-by: Matti Vaittinen --- Revision history v2: New patch --- drivers/iio/accel/kionix-kx022a.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c index f98393d74666..09814881f513 100644 --- a/drivers/iio/accel/kionix-kx022a.c +++ b/drivers/iio/accel/kionix-kx022a.c @@ -516,17 +516,6 @@ static int kx022a_read_raw(struct iio_dev *idev, return -EINVAL; }; -static int kx022a_validate_trigger(struct iio_dev *idev, - struct iio_trigger *trig) -{ - struct kx022a_data *data = iio_priv(idev); - - if (data->trig != trig) - return -EINVAL; - - return 0; -} - static int kx022a_set_watermark(struct iio_dev *idev, unsigned int val) { struct kx022a_data *data = iio_priv(idev); @@ -725,7 +714,7 @@ static const struct iio_info kx022a_info = { .write_raw = &kx022a_write_raw, .read_avail = &kx022a_read_avail, - .validate_trigger = kx022a_validate_trigger, + .validate_trigger = iio_validate_own_trigger, .hwfifo_set_watermark = kx022a_set_watermark, .hwfifo_flush_to_buffer = kx022a_fifo_flush, };