From patchwork Mon May 8 10:31:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 13234289 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 157A3C77B73 for ; Mon, 8 May 2023 10:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234690AbjEHKcp (ORCPT ); Mon, 8 May 2023 06:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234691AbjEHKcL (ORCPT ); Mon, 8 May 2023 06:32:11 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CCAD2676F; Mon, 8 May 2023 03:31:44 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f137dbaa4fso4989490e87.2; Mon, 08 May 2023 03:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683541901; x=1686133901; 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=ZVOcW5KSfysHy4pPWrUvfd7L7A9hkxm02fk2t4xmkTs=; b=midirEziNdd9rEplMPFT2tyoTB62QKPhg8cQcgG/bJ8utNrMkwuS+sZJB/Qb0luBdy rHUpyyrhfQ6FJL8t3rJsbnSmKjJelHAT3C6zod/h+Jl1XC18MN+Q/wbFl9jf0OD0Mi0M LwMfBCubSZgcmNDt94m/6orh2BJv1t6k2zccZhEk2pe+VXxwWQtHnEvl0jUUfiQgIClz ox0IoRVzI3y3WJO4N9TTUhUpBLeCLA+ZJZJVfOux0WrqLtX5gARt4+tsIaljysHAy1ww BH6ViLOreP+HpPmNN7u5uj8lSTlL2mSQYSb+lc9BShqcd3NcDUuxQS44yV7mLU40g1v9 QX5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683541901; x=1686133901; 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=ZVOcW5KSfysHy4pPWrUvfd7L7A9hkxm02fk2t4xmkTs=; b=HcdPnQiWt2C7Yaqk1tQ9mpXSllhZPUQqW7jkMPi8JJSd4t5b0tAI5UxV4L/OxiROe8 NqOiwaexKNweAzdFxNaQm6uaByCCBioKNCjSNUiC1RsrAhCScYPKtWp1vKddg3j5/4xQ qvUyvK3aKEidsUIYT9veqoMu2TlVb8Dzqu/xUz4HZf+nCM4+1mSWTsZ0LatwhiRpdcA4 g9LZxuKEvzJiawZW6AtXm/zKBQXITx6qf7RKxlS11AuAL+kyAUx23pk633UNTj8a/G37 bBauPj4Fn1Ef4bBUNTPK6TZE/kFA/UwmbMufuIUKVD0sSQD4GP68QcUxpVVYPOyDhdww qB8w== X-Gm-Message-State: AC+VfDxOOwAKD9b8e/pHGd24jdQYL/KY0yzEHNnvShZArQM8fTGmVd+e 17herwUnaVRg21Iy1sto5wo= X-Google-Smtp-Source: ACHHUZ5Y1Dv01gKb4AgUcpnypAjvvhRaAfmwQuAmjFIf03cSrRcGKdy9Zn0ZVAG5L1WBQLvp5ES84Q== X-Received: by 2002:ac2:52b6:0:b0:4f2:5393:b71 with SMTP id r22-20020ac252b6000000b004f253930b71mr18514lfm.17.1683541900903; Mon, 08 May 2023 03:31:40 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id v5-20020a197405000000b004eff32d6a21sm1243928lfe.121.2023.05.08.03.31.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 May 2023 03:31:40 -0700 (PDT) Date: Mon, 8 May 2023 13:31:35 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Matti Vaittinen , Andy Shevchenko , Zhigang Shi , Paul Gazzillo , Shreeya Patel , Dmitry Osipenko , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 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, };