lkml.org 
[lkml]   [2018]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 2/7] i2c: designware: move #ifdef CONFIG_OF to the top
    Date
    Move the #ifdef CONFIG_OF section to the top of the file, after the ACPI
    section so functions defined there can be used in dw_i2c_plat_probe.

    Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
    ---
    drivers/i2c/busses/i2c-designware-platdrv.c | 16 ++++++++--------
    1 file changed, 8 insertions(+), 8 deletions(-)

    diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
    index d5936c32c075..776d4354f366 100644
    --- a/drivers/i2c/busses/i2c-designware-platdrv.c
    +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
    @@ -169,6 +169,14 @@ static inline int dw_i2c_acpi_configure(struct platform_device *pdev)
    }
    #endif

    +#ifdef CONFIG_OF
    +static const struct of_device_id dw_i2c_of_match[] = {
    + { .compatible = "snps,designware-i2c", },
    + {},
    +};
    +MODULE_DEVICE_TABLE(of, dw_i2c_of_match);
    +#endif
    +
    static void i2c_dw_configure_master(struct dw_i2c_dev *dev)
    {
    struct i2c_timings *t = &dev->timings;
    @@ -403,14 +411,6 @@ static int dw_i2c_plat_remove(struct platform_device *pdev)
    return 0;
    }

    -#ifdef CONFIG_OF
    -static const struct of_device_id dw_i2c_of_match[] = {
    - { .compatible = "snps,designware-i2c", },
    - {},
    -};
    -MODULE_DEVICE_TABLE(of, dw_i2c_of_match);
    -#endif
    -
    #ifdef CONFIG_PM_SLEEP
    static int dw_i2c_plat_prepare(struct device *dev)
    {
    --
    2.18.0
    \
     
     \ /
      Last update: 2018-08-16 10:47    [W:6.181 / U:0.428 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site