linux-mips
[Top] [All Lists]

Re: [PATCH v3 4/7] MIPS: ath79: add a common PCI registration function

To: Sergei Shtylyov <sshtylyov@mvista.com>
Subject: Re: [PATCH v3 4/7] MIPS: ath79: add a common PCI registration function
From: Gabor Juhos <juhosg@openwrt.org>
Date: Mon, 21 Nov 2011 12:58:49 +0100
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, Rene Bolldorf <xsecute@googlemail.com>
In-reply-to: <4ECA254E.4040509@mvista.com>
References: <1321825151-16053-1-git-send-email-juhosg@openwrt.org> <1321825151-16053-5-git-send-email-juhosg@openwrt.org> <4ECA254E.4040509@mvista.com>
Sender: linux-mips-bounce@linux-mips.org
Hi Sergei,

2011.11.21. 11:17 keltezéssel, Sergei Shtylyov írta:
> Hello.
> 
> On 21-11-2011 1:39, Gabor Juhos wrote:
> 
>> The current code unconditionally registers the AR724X
>> specific PCI controller, even if the kernel is running
>> on a different SoC.
> 

<...>

>>   }
>> +
>> +int __init ath79_register_pci(void)
>> +{
>> +    int ret;
>> +
>> +    if (soc_is_ar724x())
>> +        ret = ath724x_pcibios_init();
>> +    else
>> +        ret = -ENODEV;
> 
>    Why not return right away and save 4 lines of code?

Because I have more patches which will need the if-else statement. Apart from
that, you are right it is not needed here. I will remove it from the current 
patch.

-Gabor

<Prev in Thread] Current Thread [Next in Thread>