lkml.org 
[lkml]   [2014]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 01/27] ARM: EXYNOS: Add Exynos3250 SoC ID
    Date
    On Friday 11 April 2014 16:09:57 Chanwoo Choi wrote:
    > On 04/11/2014 03:32 PM, Chanwoo Choi wrote:
    > >>>
    > >>> +#if defined(CONFIG_SOC_EXYNOS3250)
    > >>> +# define soc_is_exynos3250() is_samsung_exynos3250()
    > >>> +#else
    > >>> +# define soc_is_exynos3250() 0
    > >>> +#endif
    > >>
    > >> In general, I think we have too much code littered with soc_is_<foo>() going
    > >> on, so please try to avoid adding more for this SoC. Especially in cases where
    > >> you just want to bail out of certain features where we might already have
    > >> function pointers to control if a function is called or not, such as the
    > >> firmware interfaces.
    > >>
    > >
    > > Do you prefer dt helper function such as following function instead of new soc_is_xx() ?
    > > - of_machine_is_compatible("samsung,exynos3250")
    > >
    >
    > I think of_machine_is_compatible() is not proper alternative method.
    > of_machine_is_compatible can be only used if CONFIG_OF is enabled.
    >

    CONFIG_OF is enabled by definition, that wouldn't be a problem. However,
    of_machine_is_compatible() doesn't solve the problem that Olof mentioned,
    you still make runtime-decisions based on the SoC ID, which you should not.

    Instead, the code should be restructured so it doesn't have to know which
    SoC is being used. If some machines work differently from others, that should
    be local knowledge within the device driver, and it can use for instance
    a DT property of the device node that describes the register set the driver
    is using.

    Arnd


    \
     
     \ /
      Last update: 2014-04-11 11:01    [W:8.000 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site