Re: [PATCH 4/6] spi: altera: use regmap instead of direct mmio register access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux