Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp753975imm; Mon, 9 Jul 2018 10:01:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeYlWefJzotIMgC6NxqXRwSKfULcNAKWqET4WnfQAR6jiZuBAkd4eFjNccZVohi+PUztqHk X-Received: by 2002:a63:da04:: with SMTP id c4-v6mr3156624pgh.398.1531155663938; Mon, 09 Jul 2018 10:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531155663; cv=none; d=google.com; s=arc-20160816; b=uYgAEtqSb2TqcOBBnidkNBqmjc7iKoFCd+qPsZvq1tXx8BQ+3ty2M1G5NM02Gb7Px7 8AQwwQRqjP9DNc3mgfIM90bOpcPqkAQVhgLoKC7lfiEUx+YKlN7N+2F57w9jjSy89dL5 LPzO6/h/NzYjhNRABhH6/x/JcM1Kc66haie8/uD4a4tD2mv6DYvc2KT65YvuoaX47kcj WnFEnZfMuNOeYjOl7IbLHfzxxqYBfvzht//bd//MiCMhAL9RPTutnkGdbYFr6qxqP3qf /ZEnv3EcfAYWjHhqeIYDWll3X1E1RZ7itYuTFDOoiL5nTkS8pXui1DYWyPBloCYZdC08 rSLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=uatQ7aJiuJDprpKhu+4iVFHtY31d1UCt983Rph/OQyM=; b=asw55vaiTKdqQU7Q6pMRhdmYs28WEp1f0OqxkEG9zmevUkPaQE4L9lI2xsc9tU1zwY 80NrKh0Yr4Wr7oTlBzMEHShH9kEsnTZMjj9klCP/ZfNlZDWKRrWiMaNzkVV17enDhPDr 5XHSZ3kh/1BdzkT2JWs4cEaXyzpipLsC0jYmpobq/fddo3U1s/wDhN9YBIdR8w/Slwnf BR1mQiyFg4p+x8/NiJs4wJU+1I2aYTLJfvaNRAXwFqft6RmD+9bPHf1JB3bnpyTDK6bQ /Gz7vyAOGUN7xUlJrLvOzkSkRyo6B4DhNDH/x8zQ2ZGZmXsX9jJiesV6Ytzj9kDtPrlM Bv6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y03W5gBV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id c14-v6si16255011pfl.319.2018.07.09.10.00.49; Mon, 09 Jul 2018 10:01:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y03W5gBV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S933558AbeGIQ74 (ORCPT + 99 others); Mon, 9 Jul 2018 12:59:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:50488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933274AbeGIQ7y (ORCPT ); Mon, 9 Jul 2018 12:59:54 -0400 Received: from localhost (unknown [106.201.46.178]) (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 313D420883; Mon, 9 Jul 2018 16:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531155593; bh=x33olNrU2w/2rVY14c1ksA7c+T26jGkdIJl2PQPrtr4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y03W5gBVMOqylqr50pg8kdezTzO8SvcuQ3rlWKkJUnOhBR7odr8B/VlW3i3JX0I72 0NAx3nqeDSU7eL+SeX4Rg7lbs/Si323kdlI67KjaZ7acwus87sPnhArwPmlaP08zHw 1QqObgRrO9Pp/KmJlAmLYiOw2mE15pwCz8VmUKVQ= Date: Mon, 9 Jul 2018 22:29:45 +0530 From: Vinod To: Paul Cercueil Cc: Rob Herring , Mark Rutland , Ralf Baechle , Paul Burton , James Hogan , Zubair Lutfullah Kakakhel , Mathieu Malaterre , Daniel Silsby , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: Re: [PATCH 01/14] dmaengine: dma-jz4780: Avoid hardcoding number of channels Message-ID: <20180709165945.GH22377@vkoul-mobl> References: <20180703123214.23090-1-paul@crapouillou.net> <20180703123214.23090-2-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180703123214.23090-2-paul@crapouillou.net> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03-07-18, 14:32, Paul Cercueil wrote: > struct jz4780_dma_dev { > struct dma_device dma_device; > void __iomem *base; > struct clk *clk; > unsigned int irq; > + unsigned int nb_channels; > + enum jz_version version; > > uint32_t chan_reserved; > - struct jz4780_dma_chan chan[JZ_DMA_NR_CHANNELS]; > + struct jz4780_dma_chan chan[]; why array, why not channel pointer? > +static const unsigned int jz4780_dma_nb_channels[] = { > + [ID_JZ4780] = 32, > +}; > + > +static const struct of_device_id jz4780_dma_dt_match[] = { > + { .compatible = "ingenic,jz4780-dma", .data = (void *)ID_JZ4780 }, > + {}, > +}; Looking at description I was hoping that channels would be in DT, channels is hardware information, so should come from DT rather than coding the kernel... > - jzdma = devm_kzalloc(dev, sizeof(*jzdma), GFP_KERNEL); > + if (of_id) > + version = (enum jz_version)of_id->data; > + else > + version = ID_JZ4780; /* Default when not probed from DT */ where else would it be probed from.... ? -- ~Vinod