diff mbox

mmc: tegra: convert to device tree support only

Message ID 1345187071-6619-1-git-send-email-josephl@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joseph Lo Aug. 17, 2012, 7:04 a.m. UTC
When compiling a kernel that supports only Tegra30 and not Tegra20,
the SDHCI driver will fail to compile since the of_match_device() failure
fallback code unconditinally references soc_data_tegra20, which is only
compiled in when Tegra20 support is enabled.

In Kernel 3.7, both Tegra20 and Tegra30 will only support booting using
device tree, Hence, there is never a need to fall back to using
soc_data_tegra20 if of_mach_device() fails. Instead, make this case an
error. This removes the reference to soc_data_tegra20, and hence solves
the compile failure.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
---
 drivers/mmc/host/sdhci-tegra.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

Comments

Stephen Warren Aug. 17, 2012, 7:01 p.m. UTC | #1
On 08/17/2012 01:04 AM, Joseph Lo wrote:
> When compiling a kernel that supports only Tegra30 and not Tegra20,
> the SDHCI driver will fail to compile since the of_match_device() failure
> fallback code unconditinally references soc_data_tegra20, which is only
> compiled in when Tegra20 support is enabled.
> 
> In Kernel 3.7, both Tegra20 and Tegra30 will only support booting using
> device tree, Hence, there is never a need to fall back to using
> soc_data_tegra20 if of_mach_device() fails. Instead, make this case an
> error. This removes the reference to soc_data_tegra20, and hence solves
> the compile failure.

Tested-by: Stephen Warren <swarren@wwwdotorg.org>

(built and tested both Tegra20-only and Tegr30-only kernels with this
applied on top of next-20120816).
Joseph Lo Aug. 24, 2012, 1:40 a.m. UTC | #2
On Sat, 2012-08-18 at 03:01 +0800, Stephen Warren wrote:
> On 08/17/2012 01:04 AM, Joseph Lo wrote:
> > When compiling a kernel that supports only Tegra30 and not Tegra20,
> > the SDHCI driver will fail to compile since the of_match_device() failure
> > fallback code unconditinally references soc_data_tegra20, which is only
> > compiled in when Tegra20 support is enabled.
> > 
> > In Kernel 3.7, both Tegra20 and Tegra30 will only support booting using
> > device tree, Hence, there is never a need to fall back to using
> > soc_data_tegra20 if of_mach_device() fails. Instead, make this case an
> > error. This removes the reference to soc_data_tegra20, and hence solves
> > the compile failure.
> 
> Tested-by: Stephen Warren <swarren@wwwdotorg.org>
> 
> (built and tested both Tegra20-only and Tegr30-only kernels with this
> applied on top of next-20120816).

Ping.

Could anyone help to review this?
Thanks.
Chris Ball Aug. 27, 2012, 10:28 p.m. UTC | #3
Hi,

On Thu, Aug 23 2012, Joseph Lo wrote:
> On Sat, 2012-08-18 at 03:01 +0800, Stephen Warren wrote:
>> On 08/17/2012 01:04 AM, Joseph Lo wrote:
>> > When compiling a kernel that supports only Tegra30 and not Tegra20,
>> > the SDHCI driver will fail to compile since the of_match_device() failure
>> > fallback code unconditinally references soc_data_tegra20, which is only
>> > compiled in when Tegra20 support is enabled.
>> > 
>> > In Kernel 3.7, both Tegra20 and Tegra30 will only support booting using
>> > device tree, Hence, there is never a need to fall back to using
>> > soc_data_tegra20 if of_mach_device() fails. Instead, make this case an
>> > error. This removes the reference to soc_data_tegra20, and hence solves
>> > the compile failure.
>> 
>> Tested-by: Stephen Warren <swarren@wwwdotorg.org>
>> 
>> (built and tested both Tegra20-only and Tegr30-only kernels with this
>> applied on top of next-20120816).
>
> Ping.

Thanks, pushed to mmc-next for 3.7.

- Chris.
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 0810ccc..436186c 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -257,10 +257,9 @@  static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
 	int rc;
 
 	match = of_match_device(sdhci_tegra_dt_match, &pdev->dev);
-	if (match)
-		soc_data = match->data;
-	else
-		soc_data = &soc_data_tegra20;
+	if (!match)
+		return -EINVAL;
+	soc_data = match->data;
 
 	host = sdhci_pltfm_init(pdev, soc_data->pdata);
 	if (IS_ERR(host))