26 Aug, 2015

1 commit

  • When a default bus like the simple-bus should be used someone had to
    call of_platform_populate() with the default match table. This match
    table was not exported, so it is impossible for code build as a module
    to use this. Instead of exporting of_default_bus_match_table, add a new
    function which uses this default match table and populates the bus.

    Signed-off-by: Hauke Mehrtens
    Signed-off-by: Rob Herring

    Hauke Mehrtens
     

13 Mar, 2015

1 commit

  • sparc:allmodconfig fails to build with:

    drivers/built-in.o: In function `platform_bus_init':
    (.init.text+0x3684): undefined reference to `of_platform_register_reconfig_notifier'

    of_platform_register_reconfig_notifier is only declared if both OF_ADDRESS
    and OF_DYNAMIC are configured. Yet, the include file only declares a dummy
    function if OF_DYNAMIC is not configured. The sparc architecture does not
    configure OF_ADDRESS, but does configure OF_DYNAMIC, causing above error.

    Fixes: 801d728c10db ("of/reconfig: Add OF_DYNAMIC notifier for platform_bus_type")
    Cc: Pantelis Antoniou
    Signed-off-by: Guenter Roeck
    Signed-off-by: Rob Herring

    Guenter Roeck
     

25 Nov, 2014

1 commit


07 Jul, 2014

1 commit

  • of_platform_destroy does not work properly, since the tree
    population test was iterating on all devices having as its parent
    the given platform device.

    The check was intended to check whether any other platform or amba
    devices created by of_platform_populate were still populated, but
    instead checked for every kind of device. This is wrong, since platform
    devices typically create a subsystem regular device and set themselves
    as parents.

    Instead, go ahead and call the unregister functions for any devices
    created with of_platform_populate. The driver core will take care of
    unbinding drivers, and drivers are responsible for getting rid of any
    child devices that weren't created by of_platform_populate.

    Signed-off-by: Grant Likely
    Signed-off-by: Pantelis Antoniou

    Grant Likely
     

04 Jun, 2014

1 commit

  • Pull trivial tree changes from Jiri Kosina:
    "Usual pile of patches from trivial tree that make the world go round"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (23 commits)
    staging: go7007: remove reference to CONFIG_KMOD
    aic7xxx: Remove obsolete preprocessor define
    of: dma: doc fixes
    doc: fix incorrect formula to calculate CommitLimit value
    doc: Note need of bc in the kernel build from 3.10 onwards
    mm: Fix printk typo in dmapool.c
    modpost: Fix comment typo "Modules.symvers"
    Kconfig.debug: Grammar s/addition/additional/
    wimax: Spelling s/than/that/, wording s/destinatary/recipient/
    aic7xxx: Spelling s/termnation/termination/
    arm64: mm: Remove superfluous "the" in comment
    of: Spelling s/anonymouns/anonymous/
    dma: imx-sdma: Spelling s/determnine/determine/
    ath10k: Improve grammar in comments
    ath6kl: Spelling s/determnine/determine/
    of: Improve grammar for of_alias_get_id() documentation
    drm/exynos: Spelling s/contro/control/
    radio-bcm2048.c: fix wrong overflow check
    doc: printk-formats: do not mention casts for u64/s64
    doc: spelling error changes
    ...

    Linus Torvalds
     

16 May, 2014

1 commit

  • In "Device Tree powered" systems, platform devices are usually massively
    populated with of_platform_populate() call, executed at some level of
    initcalls, either by generic architecture or by platform-specific code.

    There are situations though where certain devices must be created (and
    bound with drivers) before all the others. This presents a challenge,
    as devices created explicitly would be created again by
    of_platform_populate().

    This patch tries to solve that issue in a generic way, adding a
    "populated" flag for a DT node description. Subsequent
    of_platform_populate() will skip such nodes (and its children) in
    a similar way to the non-available ones.

    This patch also adds of_platform_depopulate() as an operation
    complementary to the _populate() one. It removes a platform or an amba
    device populated from the Device Tree, together with its all children
    (leaving, however, devices without associated of_node untouched)
    clearing the "populated" flag on the way.

    Signed-off-by: Pawel Moll
    Reviewed-by: Rob Herring
    Acked-by: Grant Likely

    Pawel Moll
     

05 May, 2014

1 commit


12 Jun, 2013

2 commits

  • The last user of of_platform_driver is converted to a regular
    platform_driver, so of_platform_driver can be removed now.

    Signed-off-by: Rob Herring
    Acked-by: Arnd Bergmann
    Tested-by: Benjamin Herrenschmidt
    Signed-off-by: Grant Likely

    Rob Herring
     
  • A lot of code uses the functions from of_platform.h when built for
    devicetree-enabled platforms but can also be built without them.
    In order to avoid using #ifdef everywhere in drivers, this
    makes all the function declarations visible, which means we
    can use "if (IS_ENABLED(CONFIG_OF))" in driver code and get build
    coverage over the code but let the compiler drop the reference
    in the object code.

    Signed-off-by: Arnd Bergmann
    Cc: Grant Likely
    Cc: Rob Herring
    Signed-off-by: Grant Likely

    Arnd Bergmann
     

10 Apr, 2013

1 commit

  • Fix the following compilation warnings (in Simon Horman's renesas.git repo):

    In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
    include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’ declared
    inside parameter list [enabled by default]
    include/linux/of_platform.h:107:13: warning: its scope is only this definition
    or declaration, which is probably not what you want [enabled by default]
    include/linux/of_platform.h:107:13: warning: ‘struct device_node’ declared
    inside parameter list [enabled by default]

    only #include's headers with definitions of the above
    mentioned structures if CONFIG_OF_DEVICE=y but uses them even if not. One
    solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE and use
    incomplete declarations for the rest of the structures where the #ifdef move
    doesn't help...

    Reported-by: Vladimir Barinov
    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Rob Herring

    Sergei Shtylyov
     

20 Dec, 2012

1 commit

  • Fixes the following warning:

    include/linux/of_platform.h:106:13: warning: 'struct device' declared
    inside parameter list [enabled by default]
    include/linux/of_platform.h:106:13: warning: its scope is only this
    definition or declaration, which is probably not what you want [enabled
    by default]

    Signed-off-by: Jonas Gorski
    Signed-off-by: Rob Herring
    Signed-off-by: Grant Likely

    Jonas Gorski
     

05 Mar, 2012

1 commit


27 Feb, 2012

1 commit

  • Sparc has its own helpers for translating address ranges when the device
    tree is parsed at boot time, and it isn't able to use of_platform_populate().
    However, there are some device drivers that want to use that function on
    other DT enabled platforms (ie. TWL4030). This patch adds an empty
    of_platform_populate() implementation that returns an error when
    CONFIG_OF_ADDRESS is not selected.

    Signed-off-by: Grant Likely
    Cc: Benoit Cousson
    Cc: Samuel Ortiz

    Grant Likely
     

01 Nov, 2011

1 commit


22 Jun, 2011

3 commits


24 Mar, 2011

1 commit


02 Mar, 2011

1 commit

  • Commit eca393016, "of: Merge of_platform_bus_type with
    platform_bus_type" added a shim to allow of_platform_drivers to get
    registers onto the platform bus so that there was time to migrate the
    existing drivers to the platform_bus_type.

    This patch removes the shim since there are no more users of the old
    interface.

    Signed-off-by: Grant Likely

    Grant Likely
     

28 Feb, 2011

1 commit

  • arch/powerpc/kernel/ibmebus.c is the only remaining user of the
    of_bus_type support code for initializing the bus and registering
    drivers. All others have either been switched to the vanilla platform
    bus or already have their own infrastructure.

    This patch moves the functionality that ibmebus is using out of
    drivers/of/{platform,device}.c and into ibmebus.c where it is actually
    used. Also renames the moved symbols from of_platform_* to
    ibmebus_bus_* to reflect the actual usage.

    This patch is part of moving all of the of_platform_bus_type users
    over to the platform_bus_type.

    Signed-off-by: Grant Likely

    Grant Likely
     

06 Aug, 2010

1 commit

  • of_device is just an alias for platform_device, so remove it entirely. Also
    replace to_of_device() with to_platform_device() and update comment blocks.

    This patch was initially generated from the following semantic patch, and then
    edited by hand to pick up the bits that coccinelle didn't catch.

    @@
    @@
    -struct of_device
    +struct platform_device

    Signed-off-by: Grant Likely
    Reviewed-by: David S. Miller

    Grant Likely
     

24 Jul, 2010

5 commits

  • This list used was by only two platforms with all other platforms defining an
    own list of valid bus id's to pass to of_platform_bus_probe. This patch:

    i) copies the default list to the two platforms that depended on it (powerpc)
    ii) remove the usage of of_default_bus_ids in of_platform_bus_probe
    iii) removes the definition of the list from all architectures that defined it

    Passing a NULL 'matches' parameter to of_platform_bus_probe is still valid; the
    function returns no error in that case as the NULL value is equivalent to an
    empty list.

    Signed-off-by: Jonas Bonn
    [grant.likely@secretlab.ca: added __initdata annotations, warn on and return error on missing match table, and fix whitespace errors]
    Signed-off-by: Grant Likely

    Jonas Bonn
     
  • of_device is currently just an #define alias to platform_device until it
    gets removed entirely. This patch removes references to it from the
    include directories and the core drivers/of code.

    Signed-off-by: Grant Likely
    Acked-by: David S. Miller

    Grant Likely
     
  • Only thing left in it is of_instantiate_rtc() which can be moved to
    asm/prom.h on PowerPC and is unused in microblaze.

    Signed-off-by: Grant Likely
    Acked-by: David S. Miller

    Grant Likely
     
  • Both of_bus_type and of_platform_bus_type are just #define aliases
    for the platform bus. This patch removes all references to them and
    switches to the of_register_platform_driver()/of_unregister_platform_driver()
    API for registering.

    Subsequent patches will convert each user of of_register_platform_driver()
    into plain platform_drivers without the of_platform_driver shim. At which
    point the of_register_platform_driver()/of_unregister_platform_driver()
    functions can be removed.

    Signed-off-by: Grant Likely
    Acked-by: David S. Miller

    Grant Likely
     
  • of_platform_bus was being used in the same manner as the platform_bus.
    The only difference being that of_platform_bus devices are generated
    from data in the device tree, and platform_bus devices are usually
    statically allocated in platform code. Having them separate causes
    the problem of device drivers having to be registered twice if it
    was possible for the same device to appear on either bus.

    This patch removes of_platform_bus_type and registers all of_platform
    bus devices and drivers on the platform bus instead. A previous patch
    made the of_device structure an alias for the platform_device structure,
    and a shim is used to adapt of_platform_drivers to the platform bus.

    After all of of_platform_bus drivers are converted to be normal platform
    drivers, the shim code can be removed.

    Signed-off-by: Grant Likely
    Acked-by: David S. Miller

    Grant Likely
     

06 Jul, 2010

2 commits

  • This patch merges the common routines of_device_alloc() and
    of_device_make_bus_id() from powerpc and microblaze.

    Signed-off-by: Grant Likely
    CC: Michal Simek
    CC: Grant Likely
    CC: Benjamin Herrenschmidt
    CC: Stephen Rothwell
    CC: microblaze-uclinux@itee.uq.edu.au
    CC: linuxppc-dev@ozlabs.org
    CC: devicetree-discuss@lists.ozlabs.org

    Grant Likely
     
  • Merge common code between PowerPC and microblaze. This patch merges
    the code that scans the tree and registers devices. The functions
    merged are of_platform_bus_probe(), of_platform_bus_create(), and
    of_platform_device_create().

    This patch also move the of_default_bus_ids[] table out of a Microblaze
    header file and makes it non-static. The device ids table isn't merged
    because powerpc and microblaze use different default data.

    Signed-off-by: Grant Likely
    CC: Michal Simek
    CC: Grant Likely
    CC: Benjamin Herrenschmidt
    CC: Stephen Rothwell
    CC: microblaze-uclinux@itee.uq.edu.au
    CC: linuxppc-dev@ozlabs.org

    Grant Likely
     

22 May, 2010

1 commit

  • .name, .match_table and .owner are duplicated in both of_platform_driver
    and device_driver. This patch is a removes the extra copies from struct
    of_platform_driver and converts all users to the device_driver members.

    This patch is a pretty mechanical change. The usage model doesn't change
    and if any drivers have been missed, or if anything has been fixed up
    incorrectly, then it will fail with a compile time error, and the fixup
    will be trivial. This patch looks big and scary because it touches so
    many files, but it should be pretty safe.

    Signed-off-by: Grant Likely
    Acked-by: Sean MacLennan

    Grant Likely
     

29 Apr, 2010

1 commit


03 May, 2009

1 commit

  • Some drivers using of_register_platform_driver() wrapper break on sparc
    because the wrapper isn't in the header file. This patch moves it from
    Microblaze and PowerPC implementations and makes it common code.

    Fixes this sparc64 allmodconfig build error (at least):

    drivers/leds/leds-gpio.c: In function `gpio_led_init':
    drivers/leds/leds-gpio.c:295: error: implicit declaration of function `of_register_platform_driver'
    drivers/leds/leds-gpio.c: In function `gpio_led_exit':
    drivers/leds/leds-gpio.c:311: error: implicit declaration of function `of_unregister_platform_driver'

    Signed-off-by: Grant Likely
    Acked-by: David S. Miller
    Cc: Michal Simek
    Cc: Benjamin Herrenschmidt
    Cc: Stephen Rothwell
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Grant Likely
     

05 Dec, 2008

1 commit


18 Oct, 2007

1 commit


22 Jul, 2007

2 commits


20 Jul, 2007

2 commits

  • and populate it with the common parts from PowerPC and Sparc[64].

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell
     
  • Move common stuff from asm-powerpc/of_platform.h to here and
    move the common bits from asm-sparc*/of_device.h here as well.

    Create asm-sparc*/of_platform.h and move appropriate parts of
    of_device.h to them.

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell