From patchwork Wed May 3 09:49:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13230000 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 DB6ACC7EE2A for ; Wed, 3 May 2023 09:50:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229532AbjECJuA (ORCPT ); Wed, 3 May 2023 05:50:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbjECJtV (ORCPT ); Wed, 3 May 2023 05:49:21 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C1FE2D69; Wed, 3 May 2023 02:49:20 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2ac762d3bb4so2927141fa.3; Wed, 03 May 2023 02:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683107359; x=1685699359; 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=gNfztD5IFeiMLJNR6jD97/4QcEBh7JiWp8/CtQhQKNg=; b=C3eqKMwoG/xkWXmyi6gnmUd6Vf+TyQUVTgWvf95obEr9w2nuz1t1VE6pSwu1kh/PMf fEPGIf2bSjaABUnfTNyTvGmvrWQ3fH2tKj+d3ucNKua1LPSilf2Cp6FkBazmMmmuuhvw dIuQYswKjBwpM03n+/fn7GPMBbpt+CDIbN1JOwvhDcLKFDJXs0M1dvPrvJUB0IzhORFB 9b8Nq4Had8zYE2t70+tR4WDxt6pgR5O6kD2Fdwxk7HdXpeVOq9hvDjl+ZYqoHCTy63O5 6fNEYpGP0GQ9kq67DBIyKhCb1PDfXb8ZSl8s/0UZy/QdA9lwmx6H6etM3dneTsGyCrkg Ah3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683107359; x=1685699359; 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=gNfztD5IFeiMLJNR6jD97/4QcEBh7JiWp8/CtQhQKNg=; b=Stn+40jYb94wcX5VUm67unMhScX322PoIW+D2QZ869VS2+f78f9/m+U1IsVdvHxqom exZ2u04laibUASK9fVJ1y9x+NApa6WEqnEQ+zjP9XARSAJ07ib7Wti5dWfce+4znHV0z Eu8IwA/Ofwhx/BbBeTnPHeNcaBxTqXBC6o6PIsLbEq7yQW5lhYtVI+LankmtjqFT/f94 JDr5och5HOEUaJt75myawns8KgiG4J+3/gIJmkZ3yrdwRADTvJcj2U6BBWdf63ega9BA TbX3AdRwuWvsFJmx0eLgVQzGrn1/P/uSesJwaX5FUZy/LMTGMGO1sRnFn8cA/Hsh96FQ w9Wg== X-Gm-Message-State: AC+VfDxhKgjj6BC1k+Ubh2aximRF946sjcNbL9Hb8VtyZs2yICYUxp93 AB3hhAjSKgK9UnPqILXYQmo= X-Google-Smtp-Source: ACHHUZ7bNNzCiu5IqA3ti/UBfRkpkF8iDOSkRYZpB8Dvrj4NEFz110AG5K+l4BG3s/XYfFO6u6yVjQ== X-Received: by 2002:a2e:90ce:0:b0:2a8:bc05:ab4 with SMTP id o14-20020a2e90ce000000b002a8bc050ab4mr5658329ljg.34.1683107358900; Wed, 03 May 2023 02:49:18 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id z4-20020a2e8e84000000b002a8bbd919f8sm5909214ljk.6.2023.05.03.02.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:49:18 -0700 (PDT) Date: Wed, 3 May 2023 12:49:14 +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 , Dmitry Osipenko , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/5] iio: kx022a: Use new iio_validate_own_trigger() Message-ID: 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, };