[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200611110211.GD4671@sirena.org.uk>
Date: Thu, 11 Jun 2020 12:02:11 +0100
From: Mark Brown <broonie@...nel.org>
To: Xu Yilun <yilun.xu@...el.com>
Cc: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
trix@...hat.com, hao.wu@...el.com, matthew.gerlach@...ux.intel.com,
russell.h.weight@...el.com
Subject: Re: [PATCH 4/6] spi: altera: use regmap instead of direct mmio
register access
On Thu, Jun 11, 2020 at 11:25:09AM +0800, Xu Yilun wrote:
> + if (pdata && pdata->use_parent_regmap) {
> + hw->regmap = dev_get_regmap(pdev->dev.parent, NULL);
> + if (!hw->regmap) {
> + dev_err(&pdev->dev, "get regmap failed\n");
> + goto exit;
> + }
> + hw->base = pdata->regoff;
This seems very confused - there's some abstraction problem here. This
looks like the driver should know about whatever is causing it to use
the parent regmap, it shouldn't just be "use the parent regmap" directly
since that is too much of an implementation detail. This new feature
also seems like a separate change which should be in a separate patch,
the changelog only talked about converting to use regmap which I'd have
expected to be a straight 1:1 replacement of non-regmap stuff with
regmap stuff.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists