From patchwork Wed Jul 27 18:18:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Simmons-Talbott X-Patchwork-Id: 12930700 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 C4D72C3F6B0 for ; Wed, 27 Jul 2022 19:03:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230057AbiG0TDA (ORCPT ); Wed, 27 Jul 2022 15:03:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231623AbiG0TCg (ORCPT ); Wed, 27 Jul 2022 15:02:36 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCA27624E; Wed, 27 Jul 2022 11:19:27 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id f14so13927391qkm.0; Wed, 27 Jul 2022 11:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0nEd7dseFbDtfUvUd6FnM8ULF2DOAHEX1K0BhzerKVg=; b=D1yN8TX647mmlCmQrhoypA516wTafMg9xHgs0sc5gckZ/OyeKa2dIy8PzhYGqZRVYN FML+KzKtitTOZOz49pqDDoFLnbVWqPgc1UY8WSbhfCeeJu2CpPBoRRzBHC1MV6f/Q53u NQvf4sCDSyrKnRZOu7j5jJdxySkA22SpHHJt9NfHdie1AiLEGEcysP6EHH4QGHA0xysD q/an8T80N2ZVC5KnQuJ9usjfE7BDi5fBWXt43KG2GH+WH4/hydkvdJ+TYSlVzFOx4kho qKVpZNkfF+4u2+2wIMirTfbmI4yXJrNV1vkx47eOyj9yH1M7wsP0B0uXl+MBV5oUDINd WtYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0nEd7dseFbDtfUvUd6FnM8ULF2DOAHEX1K0BhzerKVg=; b=X7V0jUtsMWz930Z3wwi1QV4+EEeAhK7fa5C5D0A8hwrttcFDhuAppoGrub7j1Jay58 f7QoDtWi+iMmcEAf08Tecj+tNjLBw7Pe80SPqAltJkt37lQCah/QUWTgiLYtcb4LL/SU lkbJxdXGwQxyGd7o6pmuKSIeXTTWdol8xUqkr0gzuiTLDjAqTEQMF7Tj1zjnjssa2+zH Rae1xTW7Q/e8Qfk0NYHoYFFNTVnfLir8e0D/eDLw+i76tIfiRDlywc70q9AIrB5bRPmr 1xgKvIE/v+c0vAgnMNIZrBdd0xQ1hqiCn6+INZPrOKblJghogxuHh8fHPa4a7+TGVADX TkcQ== X-Gm-Message-State: AJIora/Jr4EdKXMxuM6J5pmsUoSdlwHVx0TLCVEZuZCpG5xpMxGHBFOk 60F7TN2cYEgEWUEPynTriLc= X-Google-Smtp-Source: AGRyM1t+MFIyDzilY4q6pSE0QC2uhfUDA5VjKkgVfl595cUBsosWuir5FTpJ+mrEh0rI7kgdCn6YSg== X-Received: by 2002:a05:620a:2f8:b0:6b5:e8a2:cf3d with SMTP id a24-20020a05620a02f800b006b5e8a2cf3dmr16676748qko.447.1658945966891; Wed, 27 Jul 2022 11:19:26 -0700 (PDT) Received: from spruce.. (c-71-206-142-238.hsd1.va.comcast.net. [71.206.142.238]) by smtp.gmail.com with ESMTPSA id bk27-20020a05620a1a1b00b006af1f0af045sm13195972qkb.107.2022.07.27.11.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 11:19:26 -0700 (PDT) From: Joe Simmons-Talbott To: Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joe Simmons-Talbott Subject: [PATCH 1/2] iio: Add blank lines after declarations. Date: Wed, 27 Jul 2022 14:18:54 -0400 Message-Id: <20220727181855.589052-2-joetalbott@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220727181855.589052-1-joetalbott@gmail.com> References: <20220727181855.589052-1-joetalbott@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org As reported by checkpatch.pl add blank lines after declarations. Signed-off-by: Joe Simmons-Talbott --- drivers/iio/industrialio-buffer.c | 1 + drivers/iio/industrialio-core.c | 7 +++++++ drivers/iio/industrialio-trigger.c | 1 + 3 files changed, 9 insertions(+) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index acc2b6c05d57..47a6e97f8e48 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -940,6 +940,7 @@ struct iio_demux_table { static void iio_buffer_demux_free(struct iio_buffer *buffer) { struct iio_demux_table *p, *q; + list_for_each_entry_safe(p, q, &buffer->demux_list, l) { list_del(&p->l); kfree(p); diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 0f4dbda3b9d3..40ebc63b7919 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -236,6 +236,7 @@ static int iio_sysfs_match_string_with_gaps(const char * const *array, size_t n, struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) { struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); + return iio_dev_opaque->debugfs_dentry; } EXPORT_SYMBOL_GPL(iio_get_debugfs_dentry); @@ -447,6 +448,7 @@ static const struct file_operations iio_debugfs_reg_fops = { static void iio_device_unregister_debugfs(struct iio_dev *indio_dev) { struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); + debugfs_remove_recursive(iio_dev_opaque->debugfs_dentry); } @@ -1021,6 +1023,7 @@ int __iio_device_attr_init(struct device_attribute *dev_attr, int ret = 0; char *name = NULL; char *full_postfix; + sysfs_attr_init(&dev_attr->attr); /* Build up postfix of __postfix */ @@ -1355,6 +1358,7 @@ static int iio_device_add_channel_sysfs(struct iio_dev *indio_dev, if (chan->ext_info) { unsigned int i = 0; + for (ext_info = chan->ext_info; ext_info->name; ext_info++) { ret = __iio_add_chan_devattr(ext_info->name, chan, @@ -1403,6 +1407,7 @@ static ssize_t name_show(struct device *dev, struct device_attribute *attr, char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); + return sysfs_emit(buf, "%s\n", indio_dev->name); } @@ -1412,6 +1417,7 @@ static ssize_t label_show(struct device *dev, struct device_attribute *attr, char *buf) { struct iio_dev *indio_dev = dev_to_iio_dev(dev); + return sysfs_emit(buf, "%s\n", indio_dev->label); } @@ -1777,6 +1783,7 @@ static int iio_chrdev_release(struct inode *inode, struct file *filp) struct iio_dev_opaque *iio_dev_opaque = container_of(inode->i_cdev, struct iio_dev_opaque, chrdev); struct iio_dev *indio_dev = &iio_dev_opaque->indio_dev; + kfree(ib); clear_bit(IIO_BUSY_BIT_POS, &iio_dev_opaque->flags); iio_device_put(indio_dev); diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index b78814d869b7..6885a186fe27 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -50,6 +50,7 @@ static ssize_t name_show(struct device *dev, struct device_attribute *attr, char *buf) { struct iio_trigger *trig = to_iio_trigger(dev); + return sysfs_emit(buf, "%s\n", trig->name); } From patchwork Wed Jul 27 18:18:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Simmons-Talbott X-Patchwork-Id: 12930699 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 B0590C19F21 for ; Wed, 27 Jul 2022 19:03:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233074AbiG0TDA (ORCPT ); Wed, 27 Jul 2022 15:03:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231847AbiG0TCh (ORCPT ); Wed, 27 Jul 2022 15:02:37 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FB156265; Wed, 27 Jul 2022 11:19:29 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id m7so13879101qkk.6; Wed, 27 Jul 2022 11:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E/Gq00KE6z/WOdOuLSctfeQoLznSTYhNp0nMcDpDWKM=; b=a7ec0Df0WU4BEc4saTHyOMcGEysyY286feVLVf5B24fJZvP8xzpsHe+mGmneU3LSu5 v9G3Twgw6iFdZ4HnV3LsK/QZshMgi+htdAkdwUXgWuDNdPLxhYrCuHMvR5kZFotMfmJT oRFT+6SEImtPYUjusbOtUu09v0n8xOFj8jYzZLcVotu+qUHOXQzvPa+zGsd5QXXZoMCu xCjkiwnSnOIzUHK6X3llezCA9XA6GR1p2PYrRBXsumVeV41EQhZk7V5rTfOrFSB96Q42 nyTTV5DC8hgAU0Rr8DGYLKcTZWsHHHWJSbLP7E1a35NmsJJTW+R9mo0MJYOCXlPjchH0 5i5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E/Gq00KE6z/WOdOuLSctfeQoLznSTYhNp0nMcDpDWKM=; b=kWtFxKhSIygKJXK1TG7qIYQ4eHbrJ87riJCoZOTxDT93tlTSRugvkTexHupZDOmylN FFAtq3jZH0WzHQHbRL6YP2GR0AylTx6FbF0tbXi1+lZxmNnM4Z/o+n0geeQXzux3+m1n hvTv4bz7xYEirFxyvXi/zDPx6jz5tevewECytMIvMwRJF5Xc1OEyPDzoX34yRvkTMxD6 31k7jhxghk8GKmu8yU7FlHL7wG4W4BGUrkBkhg/HQaqFM5/Mf+RrtH+NHHyCrxkfxdSQ psolvDLXBD1DxKkHlQ/WGVChdiyrUrG4/nvEePUiYYCqwrUERcBo1YlIDzSOuESIOhAJ cIdg== X-Gm-Message-State: AJIora8+1TDTzmQJrwIBzARsxNwtghEzSyUkBa0s1SlN5vnsGZUBHYZX +G1G54KyOoBlaXZhS4U8T/Q= X-Google-Smtp-Source: AGRyM1tbhgMs3Q98l5Srs8NM1XqHrGMXA9rXr2Lf4Uv1t8WwwS/4p02rIeBaH07WYAyAb+ZQj0B8hA== X-Received: by 2002:a05:620a:4306:b0:6a9:7122:edb2 with SMTP id u6-20020a05620a430600b006a97122edb2mr17710321qko.502.1658945968724; Wed, 27 Jul 2022 11:19:28 -0700 (PDT) Received: from spruce.. (c-71-206-142-238.hsd1.va.comcast.net. [71.206.142.238]) by smtp.gmail.com with ESMTPSA id bk27-20020a05620a1a1b00b006af1f0af045sm13195972qkb.107.2022.07.27.11.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 11:19:28 -0700 (PDT) From: Joe Simmons-Talbott To: Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joe Simmons-Talbott Subject: [PATCH 2/2] iio: Fix indentation for multiline conditional. Date: Wed, 27 Jul 2022 14:18:55 -0400 Message-Id: <20220727181855.589052-3-joetalbott@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220727181855.589052-1-joetalbott@gmail.com> References: <20220727181855.589052-1-joetalbott@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org As reported by checkpatch.pl make indentation match previous conditional. Signed-off-by: Joe Simmons-Talbott --- drivers/iio/industrialio-buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 47a6e97f8e48..228598b82a2f 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -843,8 +843,8 @@ static int iio_verify_update(struct iio_dev *indio_dev, * to verify. */ if (remove_buffer && !insert_buffer && - list_is_singular(&iio_dev_opaque->buffer_list)) - return 0; + list_is_singular(&iio_dev_opaque->buffer_list)) + return 0; modes = indio_dev->modes;