Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4912057pxb; Mon, 15 Feb 2021 04:47:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzv8Ci6Up6B5ftM2iBpcTLob14iqqS8PpEwDqdNS+DwfccIyhnfmmxxABL2fwbFd4/Gyb/S X-Received: by 2002:a17:906:b252:: with SMTP id ce18mr1631100ejb.336.1613393279359; Mon, 15 Feb 2021 04:47:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613393279; cv=none; d=google.com; s=arc-20160816; b=b1KQd6DkjRab2eBdr0vi1lHb6yjtxcZ/nC6zVW0nynshX5cA4g5FJudk5Nh4KvuQ/J 0XNx29goe8kXYig2PMI0TvDMp73ry4SHv6CmJ8LbZjL4/qa/AnvOAOcbLZsG3F452zFk lT20w9XxAoqZhWVLstLIlmf3odE72aznNuojIHKyE531Kzie7veSwjSM0XSYn1WgdT91 +pc2VQy1i1ns8f7DPHZDd4VLZ5835C1MmtHndQ7sL+NwbOZpXW2yleKgkWvwLnO20qhL eLRl/lUiDCTStdHOICF4GxFDLw0e8xnnEc6LnIIEd1Bed3/jjy1SWLoeQDUO1WjKS12W thnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=voMCechkvrB3vcWILKDY1UWE6oO4b8sCYUoWXTI3T4U=; b=aZK62gTT1ZUBZD7ayiFQWtKjKut644Xg7yMo/E9duT1eu0kIxA1vJprKi4DK37uJrq 3AzvWR79TZ0EAlPe12thkUzz9dz/DYesVmFCLuICBAwsh/f6BBqNunkK6UisipYtNcax r95turgf5Fofxb05VBohCQBsLBbjFkNerNmF6yj/ZWwFA8cie3foeRCq/2ZcwrygOdKK ecARkuHUHRZP4wyBDrjxT4UfWYpfa8WgNlyRF8mhsY3Lvl+zvGNekUYFuizUarlvypAK c2CErvlu5z7Ol35amtLzYUejHv8ASSCjSnR1lOuJVOc2XcXbwOYzqXzT1YVJ8tFoTaRP wU3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn3si7256513edb.324.2021.02.15.04.47.35; Mon, 15 Feb 2021 04:47:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbhBOMqK (ORCPT + 99 others); Mon, 15 Feb 2021 07:46:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:56992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230332AbhBOMpT (ORCPT ); Mon, 15 Feb 2021 07:45:19 -0500 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F2E6764DEC; Mon, 15 Feb 2021 12:44:37 +0000 (UTC) Date: Mon, 15 Feb 2021 12:44:34 +0000 From: Jonathan Cameron To: Alexandru Ardelean Cc: , , , , , Subject: Re: [PATCH v6 15/24] iio: buffer: dmaengine: obtain buffer object from attribute Message-ID: <20210215124434.537196ba@archlinux> In-Reply-To: <20210215104043.91251-16-alexandru.ardelean@analog.com> References: <20210215104043.91251-1-alexandru.ardelean@analog.com> <20210215104043.91251-16-alexandru.ardelean@analog.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Feb 2021 12:40:34 +0200 Alexandru Ardelean wrote: > The reference to the IIO buffer object is stored on the attribute object. > So we need to unwind it to obtain it. > > Signed-off-by: Alexandru Ardelean This could have done with a little more description of 'why', but I'm not going to hold up the series to fix it. Jonathan > --- > drivers/iio/buffer/industrialio-buffer-dmaengine.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c > index 9981896e1495..a64b222289be 100644 > --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c > +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c > @@ -132,9 +132,9 @@ static const struct iio_dma_buffer_ops iio_dmaengine_default_ops = { > static ssize_t iio_dmaengine_buffer_get_length_align(struct device *dev, > struct device_attribute *attr, char *buf) > { > - struct iio_dev *indio_dev = dev_to_iio_dev(dev); > + struct iio_buffer *buffer = to_iio_dev_attr(attr)->buffer; > struct dmaengine_buffer *dmaengine_buffer = > - iio_buffer_to_dmaengine_buffer(indio_dev->buffer); > + iio_buffer_to_dmaengine_buffer(buffer); > > return sprintf(buf, "%zu\n", dmaengine_buffer->align); > }