Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c: New macro to initialize i2c address lists on the fly
  i2c: Don't advertise i2c functions when not available
  i2c: Use rwsem instead of mutex for board info
  i2c: Add a sysfs interface to instantiate devices
  i2c: Limit core locking to the necessary sections
  i2c: Kill the redundant client list
  i2c: Kill is_newstyle_driver
  i2c: Merge i2c_attach_client into i2c_new_device
  i2c: Drop i2c_probe function
  i2c: Get rid of the legacy binding model
  i2c: Kill client_register and client_unregister methods
This commit is contained in:
Linus Torvalds
2009-06-19 17:45:51 -07:00
7 changed files with 275 additions and 435 deletions
+4 -3
View File
@@ -18,6 +18,7 @@
#include <linux/kernel.h>
#include <linux/i2c.h>
#include <linux/rwsem.h>
#include "i2c-core.h"
@@ -25,7 +26,7 @@
/* These symbols are exported ONLY FOR the i2c core.
* No other users will be supported.
*/
DEFINE_MUTEX(__i2c_board_lock);
DECLARE_RWSEM(__i2c_board_lock);
EXPORT_SYMBOL_GPL(__i2c_board_lock);
LIST_HEAD(__i2c_board_list);
@@ -63,7 +64,7 @@ i2c_register_board_info(int busnum,
{
int status;
mutex_lock(&__i2c_board_lock);
down_write(&__i2c_board_lock);
/* dynamic bus numbers will be assigned after the last static one */
if (busnum >= __i2c_first_dynamic_bus_num)
@@ -84,7 +85,7 @@ i2c_register_board_info(int busnum,
list_add_tail(&devinfo->list, &__i2c_board_list);
}
mutex_unlock(&__i2c_board_lock);
up_write(&__i2c_board_lock);
return status;
}
+198 -359
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -16,6 +16,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/rwsem.h>
struct i2c_devinfo {
struct list_head list;
int busnum;
@@ -25,7 +27,7 @@ struct i2c_devinfo {
/* board_lock protects board_list and first_dynamic_bus_num.
* only i2c core components are allowed to use these symbols.
*/
extern struct mutex __i2c_board_lock;
extern struct rw_semaphore __i2c_board_lock;
extern struct list_head __i2c_board_list;
extern int __i2c_first_dynamic_bus_num;