From patchwork Mon Apr 24 13:08: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: 13222104 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 8D71EC7618E for ; Mon, 24 Apr 2023 13:09:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231694AbjDXNJY (ORCPT ); Mon, 24 Apr 2023 09:09:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231756AbjDXNJX (ORCPT ); Mon, 24 Apr 2023 09:09:23 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD3CC468A; Mon, 24 Apr 2023 06:08:43 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4ec94eb6dcaso4714322e87.3; Mon, 24 Apr 2023 06:08:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682341719; x=1684933719; 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=WccspPnEbBcrRpc7tjCLxW0vQshJEtnsN0ZPyzTWo8s=; b=n5FsccVK9Gn0Byub+ajDaMLf5X4ddamnxRfGaS+uTlD1AoOubwB4OqDFyKPp5P9cox wAUPqBReZqvZhhKOiQ34hC1U8J/pdNEuwga8biSNFc7GPvizMvSj3Z5G04TwIuWYAHsC 3QTfd36UJ/Nnq5TBaXwOKLJcsrwaxq+al08L3Z/yU/d65nZ+kp7mGjMhY5zi2vcGbnCk xUSGSpx6POzPb9gMGXsi/pVrT+lDPh2DmNMaLaRmT0lx2qhNRu5vy105baH2/6lCmQK1 spgWYRbUAP3XCK0wg9CfDvnpP0WC/qSWRTeuSonh1Y6izA4JvKSLHcs5NB/qXaX/D4nw gZ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682341719; x=1684933719; 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=WccspPnEbBcrRpc7tjCLxW0vQshJEtnsN0ZPyzTWo8s=; b=Y7+d1IeO/8IeiJpDlD1Y4P76cykXlP0Fuvu/BY6j/7XYG+XzWCXOvhwQQqXyzh/C3o /HkUxeWZC2Usej2/MswGKTf9H/G8fQwX1bBzFOXTdBMl3Fe+THIMUghZ/VzTm7tI5id1 X0z/qZDfDSg1dHGU5Z1X5SZ9tf8ZnSAh+xKcvKlOgR+Fg4Qj+I/tPDrinmVRrIqruqua 5kDk31/bFJ3DU98xtevCZRVF36FHFc8sS0w97X2zI2Znbc44t/NJcU56C4CPfw71x+SE D7wX3GZvkSJ8bP7coqayXiyGPWz79zHTCrttjmjcqvBuN95KdfVla/OeJ1avI3UxccGx tYAg== X-Gm-Message-State: AAQBX9flE6WB0syfo7R0cQT7y9la8DcDu5s4C14pfpHsPZ3zIDe5yvXC 3UTlNXkTtpuZXLoHWDur7Qw= X-Google-Smtp-Source: AKy350a37VsQnx9sTnnq+ZU7jhDNSrULUErRIXiGr/63SRD0WF9EIh6kIQa1hhDbf7Rq0NjhgnFeXg== X-Received: by 2002:ac2:4c30:0:b0:4eb:1158:b24c with SMTP id u16-20020ac24c30000000b004eb1158b24cmr2758085lfq.44.1682341719665; Mon, 24 Apr 2023 06:08:39 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id v25-20020a056512049900b004eff32d6a21sm291447lfq.121.2023.04.24.06.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 06:08:38 -0700 (PDT) Date: Mon, 24 Apr 2023 16:08: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 , Shreeya Patel , Paul Gazzillo , Dmitry Osipenko , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] iio: kx022a: Use new iio_validate_own_trigger() Message-ID: <0a8336feba8ccd3a8c71595b85cec36b9ef7b270.1682340947.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, };