Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1538021

Re: [PATCH v4 4/5] i2c: designware: Add slave mode as separated driver

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 4/5] i2c: designware: Add slave mode as separated driver
Date 2016-12-07 20:10 +0100
Message-ID <sLPLk-46c-55@gated-at.bofh.it> (permalink)
References <sLOFz-3bg-3@gated-at.bofh.it> <sLOFz-3bg-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Dec 07, 2016 at 05:55:51PM +0000, Luis Oliveira wrote:
> +#ifndef CONFIG_ACPI
> +	if (!device_property_match_string(&pdev->dev, "mode", "slave"))
> +		i2c_dw_configure_slave(pdev);
> +	else
> +#endif

This kind of ifdeffery doesn't make sense. A single kernel binary may
support both ACPI and DT (but only one is used at runtime). Note that
this is the case for arm64 (our Kconfig has select OF, and our defconfig
has CONFIG_ACPI=y), so this logic is broken for DT arm64 platforms.

If you're trying to ensure that this *only* works in the DT case,
explicitly check for an of_node, or use the of_* accessors.

That applies for all instances of this pattern in this driver.

Thanks,
Mark.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 4/5] i2c: designware: Add slave mode as separated driver Luis Oliveira <Luis.Oliveira@synopsys.com> - 2016-12-07 19:00 +0100
  Re: [PATCH v4 4/5] i2c: designware: Add slave mode as separated  driver Mark Rutland <mark.rutland@arm.com> - 2016-12-07 20:10 +0100
  Re: [PATCH v4 4/5] i2c: designware: Add slave mode as separated  driver Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-12-07 20:50 +0100
  Re: [PATCH v4 4/5] i2c: designware: Add slave mode as separated  driver kbuild test robot <lkp@intel.com> - 2016-12-08 05:40 +0100

csiph-web