1. 25 1月, 2008 4 次提交
  2. 13 10月, 2007 3 次提交
    • J
      Driver core: Make platform_device.id an int · 1359555e
      Jean Delvare 提交于
      While platform_device.id is a u32, platform_device_add() handles "-1"
      as a special id value. This has potential for confusion and bugs.
      Making it an int instead should prevent problems from happening in
      the future.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1359555e
    • K
      Driver core: change add_uevent_var to use a struct · 7eff2e7a
      Kay Sievers 提交于
      This changes the uevent buffer functions to use a struct instead of a
      long list of parameters. It does no longer require the caller to do the
      proper buffer termination and size accounting, which is currently wrong
      in some places. It fixes a known bug where parts of the uevent
      environment are overwritten because of wrong index calculations.
      
      Many thanks to Mathieu Desnoyers for finding bugs and improving the
      error handling.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      7eff2e7a
    • K
      platform: prefix MODALIAS with "platform:" · 43cc71ee
      Kay Sievers 提交于
      Prefix platform modalias strings with "platform:", which
      modprobe config to blacklist alias resolving if userspace
      configures it.
      
      Send uevents for all platform devices.
      
      Add MODULE_ALIAS's to: pxa2xx_pcmcia, ds1742 and pcspkr to trigger
      module autoloading by userspace.
      
        $ modinfo pcspkr
        alias:          platform:pcspkr
        license:        GPL
        description:    PC Speaker beeper driver
        ...
      
        $ modprobe -n -v platform:pcspkr
        insmod /lib/modules/2.6.23-rc3-g28e8351a-dirty/kernel/drivers/input/misc/pcspkr.ko
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      43cc71ee
  3. 09 5月, 2007 2 次提交
    • M
      drivers/base/platform.c: fix small typo in doc · 01afd806
      Márton Németh 提交于
      Typo: iwithout -> without.
      Signed-off-by: NMárton Németh <nm127@freemail.hu>
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      01afd806
    • D
      fix hotplug for legacy platform drivers · 49a4ec18
      David Brownell 提交于
      We've had various reports of some legacy "probe the hardware" style
      platform drivers having nasty problems with hotplug support.
      
      The core issue is that those legacy drivers don't fully conform to the
      driver model.  They assume a role that should be the responsibility of
      infrastructure code: creating device nodes.
      
      The "modprobe" step in hotplugging relies on drivers to have split those
      roles into different modules.  The lack of this split causes the problems.
      When a driver creates nodes for devices that don't exist (sending a hotplug
      event), then exits (aborting one modprobe) before the "modprobe $MODALIAS"
      step completes (by failing, since it's in the middle of a modprobe), the
      result can be an endless loop of modprobe invocations ...  badness.
      
      This fix uses the newish per-device flag controlling issuance of "add"
      events.  (A previous version of this patch used a per-device "driver can
      hotplug" flag, which only scrubbed $MODALIAS from the environment rather
      than suppressing the entire hotplug event.) It also shrinks that flag to
      one bit, saving a word in "struct device".
      
      So the net of this patch is removing some nasty failures with legacy
      drivers, while retaining hotplug capability for the majority of platform
      drivers.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Greg KH <gregkh@suse.de>
      Cc: Andres Salomon <dilinger@debian.org>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      49a4ec18
  4. 03 5月, 2007 1 次提交
    • J
      platform: reorder platform_device_del · dc4c15d4
      Jean Delvare 提交于
      In platform_device_del(), we currently delete the device resources
      first, then we delete the device itself. This causes a (minor) bug to
      occur when one unregisters a platform device before unregistering its
      platform driver, and the driver is requesting (in .probe()) and
      releasing (in .remove()) a resource of the device. The device
      resources are already gone by the time the driver gets the chance to
      release the resources it had been requesting, causing an error like:
      Trying to free nonexistent resource <0000000000000295-0000000000000296>
      
      If the platform driver is unregistered first, the problem doesn't
      occur, as the driver will have the opportunity to release the
      resources it had requested before the device resources themselves are
      released. It's a bit odd that unregistering the driver first or the
      device first doesn't lead to the same result.
      
      So I believe that we should delete the device first in
      platform_device_del(). I've searched the git history and found that it
      used to be the case before 2.6.8, but was changed here:
      
      http://www.kernel.org/git/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commitdiff;h=96ef7b3689936ee1e64b711511342026a8ce459c
      
      > 2004/07/14 16:09:44-07:00 dtor_core
      > [PATCH] Driver core: Fix OOPS in device_platform_unregister
      > 
      > Driver core: platform_device_unregister should release resources first
      >              and only then call device_unregister, otherwise if there
      >              are no more references to the device it will be freed and
      >              the fucntion will try to access freed memory.  
      
      However we now have an explicit call to put_device() at the end of
      platform_device_unregister() so I guess the original problem no longer
      exists and it is safe to revert that change.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      dc4c15d4
  5. 08 2月, 2007 1 次提交
  6. 14 12月, 2006 2 次提交
  7. 02 12月, 2006 1 次提交
    • D
      Driver core: platform_driver_probe(), can save codespace · c67334fb
      David Brownell 提交于
      This defines a new platform_driver_probe() method allowing the driver's
      probe() method, and its support code+data, to safely live in __init
      sections for typical system configurations.
      
      Many system-on-chip processors could benefit from this API, to the tune
      of recovering hundreds to thousands of bytes per driver.  That's memory
      which is currently wasted holding code which can never be called after
      system startup, yet can not be removed.   It can't be removed because of
      the linkage requirement that pointers to init section code (like, ideally,
      probe support) must not live in other sections (like driver method tables)
      after those pointers would be invalid.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c67334fb
  8. 26 9月, 2006 1 次提交
  9. 22 6月, 2006 2 次提交
  10. 22 3月, 2006 1 次提交
  11. 21 3月, 2006 1 次提交
  12. 14 1月, 2006 1 次提交
  13. 05 1月, 2006 3 次提交
  14. 10 11月, 2005 1 次提交
    • R
      [DRIVER MODEL] Add platform_driver · 00d3dcdd
      Russell King 提交于
      Introduce struct platform_driver.  This allows the platform device
      driver methods to be passed a platform_device structure instead of
      instead of a plain device structure, and therefore requiring casting
      in every platform driver.
      
      We introduce this in such a way that any existing platform drivers
      registered directly via driver_register continue to work as before,
      thereby allowing a gradual conversion to the new platform_driver
      methods.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      00d3dcdd
  15. 06 11月, 2005 1 次提交
  16. 31 10月, 2005 1 次提交
    • T
      [PATCH] fix missing includes · 4e57b681
      Tim Schmielau 提交于
      I recently picked up my older work to remove unnecessary #includes of
      sched.h, starting from a patch by Dave Jones to not include sched.h
      from module.h. This reduces the number of indirect includes of sched.h
      by ~300. Another ~400 pointless direct includes can be removed after
      this disentangling (patch to follow later).
      However, quite a few indirect includes need to be fixed up for this.
      
      In order to feed the patches through -mm with as little disturbance as
      possible, I've split out the fixes I accumulated up to now (complete for
      i386 and x86_64, more archs to follow later) and post them before the real
      patch.  This way this large part of the patch is kept simple with only
      adding #includes, and all hunks are independent of each other.  So if any
      hunk rejects or gets in the way of other patches, just drop it.  My scripts
      will pick it up again in the next round.
      Signed-off-by: NTim Schmielau <tim@physik3.uni-rostock.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4e57b681
  17. 30 10月, 2005 1 次提交
  18. 29 10月, 2005 2 次提交
    • R
      [PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks · 9480e307
      Russell King 提交于
      In PM v1, all devices were called at SUSPEND_DISABLE level.  Then
      all devices were called at SUSPEND_SAVE_STATE level, and finally
      SUSPEND_POWER_DOWN level.  However, with PM v2, to maintain
      compatibility for platform devices, I arranged for the PM v2
      suspend/resume callbacks to call the old PM v1 suspend/resume
      callbacks three times with each level in order so that existing
      drivers continued to work.
      
      Since this is obsolete infrastructure which is no longer necessary,
      we can remove it.  Here's an (untested) patch to do exactly that.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9480e307
    • B
      [PATCH] drivers/base - fix sparse warnings · a1bdc7aa
      Ben Dooks 提交于
      There are a number of sparse warnings from the latest sparse
      snapshot being generated from the drivers/base build. The
      main culprits are due to the initialisation functions not
      being declared in a header file.
      
      Also, the firmware.c file should include <linux/device.h>
      to get the prototype of  firmware_register() and
      firmware_unregister().
      
      This patch moves the init function declerations from the
      init.c file to the base.h, and ensures it is included in
      all the relevant c sources. It also adds <linux/device.h>
      to the included headers for firmware.c.
      
      The patch does not solve all the sparse errors generated,
      but reduces the count significantly.
      
      drivers/base/core.c:161:1: warning: symbol 'devices_subsys' was not declared. Should it be static?
      drivers/base/core.c:417:12: warning: symbol 'devices_init' was not declared. Should it be static?
      drivers/base/sys.c:253:6: warning: symbol 'sysdev_shutdown' was not declared. Should it be static?
      drivers/base/sys.c:326:5: warning: symbol 'sysdev_suspend' was not declared. Should it be static?
      drivers/base/sys.c:428:5: warning: symbol 'sysdev_resume' was not declared. Should it be static?
      drivers/base/sys.c:450:12: warning: symbol 'system_bus_init' was not declared. Should it be static?
      drivers/base/bus.c:133:1: warning: symbol 'bus_subsys' was not declared. Should it be static?
      drivers/base/bus.c:667:12: warning: symbol 'buses_init' was not declared. Should it be static?
      drivers/base/class.c:759:12: warning: symbol 'classes_init' was not declared. Should it be static?
      drivers/base/platform.c:313:12: warning: symbol 'platform_bus_init' was not declared. Should it be static?
      drivers/base/cpu.c:110:12: warning: symbol 'cpu_dev_init' was not declared. Should it be static?
      drivers/base/firmware.c:17:5: warning: symbol 'firmware_register' was not declared. Should it be static?
      drivers/base/firmware.c:23:6: warning: symbol 'firmware_unregister' was not declared. Should it be static?
      drivers/base/firmware.c:28:12: warning: symbol 'firmware_init' was not declared. Should it be static?
      drivers/base/init.c:28:13: warning: symbol 'driver_init' was not declared. Should it be static?
      drivers/base/dmapool.c:174:10: warning: implicit cast from nocast type
      drivers/base/attribute_container.c:439:1: warning: symbol 'attribute_container_init' was not declared. Should it be static?
      drivers/base/power/runtime.c:76:6: warning: symbol 'dpm_set_power_state' was not declared. Should it be static?
      Signed-off-by: NBen Dooks <ben-linux@fluff.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a1bdc7aa
  19. 13 9月, 2005 1 次提交
  20. 01 5月, 2005 1 次提交
  21. 19 4月, 2005 1 次提交
  22. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4