diff options
| author | Stefan Schmidt <stefan@datenfreihafen.org> | 2009-08-25 19:32:11 +0100 |
|---|---|---|
| committer | Stefan Schmidt <stefan@datenfreihafen.org> | 2009-08-25 19:32:11 +0100 |
| commit | efde023af7da8e638e67f1e4b755fe8d9e193371 (patch) | |
| tree | b150331f67be01bfdb249e8de4dc9fce7c908466 | |
| parent | 064ef39c2964d51dfc44eb4e38c988744830a6d4 (diff) | |
| parent | 728dd524726daf2810bb383b89a17d035cda45e7 (diff) | |
Merge branch 'org.openembedded.dev' of git@git.openembedded.org:openembedded into org.openembedded.dev
53 files changed, 375 insertions, 305 deletions
diff --git a/classes/distutils-common-base.bbclass b/classes/distutils-common-base.bbclass index 9ca392b84a..01bf9eaeba 100644 --- a/classes/distutils-common-base.bbclass +++ b/classes/distutils-common-base.bbclass @@ -8,7 +8,9 @@ def python_dir(d): staging_incdir = bb.data.getVar( "STAGING_INCDIR", d, 1 ) for majmin in "2.6 2.5 2.4 2.3".split(): if os.path.exists( "%s/python%s" % ( staging_incdir, majmin ) ): return "python%s" % majmin - raise "No Python in STAGING_INCDIR. Forgot to build python-native ?" + if not "python-native" in bb.data.getVar( "DEPENDS", d, 1 ).split(): + raise "No Python in STAGING_INCDIR. Forgot to build python-native ?" + return "INVALID" PYTHON_DIR = "${@python_dir(d)}" diff --git a/recipes/mesa/mesa-tls.inc b/classes/glx-use-tls.bbclass index 1472aa7e74..7530872fa4 100644 --- a/recipes/mesa/mesa-tls.inc +++ b/classes/glx-use-tls.bbclass @@ -1,6 +1,7 @@ - def get_tls_setting(bb, d): # until we have no prober TLS support in uclibc disable it if bb.data.getVar('TARGET_OS', d, 1).find('uclibc') >= 0 : return "" return "--enable-glx-tls" + +EXTRA_OECONF += "${@get_tls_setting(bb, d)}" diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index d084cefee8..c5192d59d4 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -78,6 +78,10 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" UBOOT_ENTRYPOINT ?= "20008000" UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" +# For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE. +# We don't want to override kernel Makefile variables from the environment +EXTRA_OEMAKE = "" + kernel_do_compile() { unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE oe_runmake include/linux/version.h CC="${KERNEL_CC}" LD="${KERNEL_LD}" @@ -182,6 +186,7 @@ kernel_do_install() { install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION} install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION} install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION} + [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION} install -d ${D}/etc/modutils if [ "${KERNEL_MAJOR_VERSION}" = "2.6" ]; then install -d ${D}/etc/modprobe.d @@ -232,7 +237,7 @@ EXPORT_FUNCTIONS do_compile do_install do_stage do_configure PACKAGES = "kernel kernel-base kernel-image kernel-dev kernel-vmlinux" FILES = "" FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*" -FILES_kernel-dev = "/boot/System.map* /boot/config*" +FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*" FILES_kernel-vmlinux = "/boot/vmlinux*" RDEPENDS_kernel = "kernel-base" RRECOMMENDS_kernel-module-hostap-cs += '${@base_version_less_or_equal("KERNEL_VERSION", "2.6.17", "", "apm-wifi-suspendfix", d)}' diff --git a/classes/patch.bbclass b/classes/patch.bbclass index 2f99e4cf30..dfb8ec960f 100644 --- a/classes/patch.bbclass +++ b/classes/patch.bbclass @@ -189,6 +189,24 @@ def patch_init(d): def Clean(self): """""" + class GitApplyTree(PatchTree): + def __init__(self, dir, d): + PatchTree.__init__(self, dir, d) + + def _applypatch(self, patch, force = False, reverse = False, run = True): + shellcmd = ["git", "--git-dir=.", "apply", "-p%s" % patch['strippath']] + + if reverse: + shellcmd.append('-R') + + shellcmd.append(patch['file']) + + if not run: + return "sh" + "-c" + " ".join(shellcmd) + + return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) + + class QuiltTree(PatchSet): def _runcmd(self, args, run = True): quiltrc = bb.data.getVar('QUILTRCFILE', self.d, 1) @@ -424,6 +442,7 @@ def patch_init(d): g["PatchSet"] = PatchSet g["PatchTree"] = PatchTree g["QuiltTree"] = QuiltTree + g["GitApplyTree"] = GitApplyTree g["Resolver"] = Resolver g["UserResolver"] = UserResolver g["NOOPResolver"] = NOOPResolver @@ -449,6 +468,7 @@ python patch_do_patch() { patchsetmap = { "patch": PatchTree, "quilt": QuiltTree, + "git": GitApplyTree, } cls = patchsetmap[bb.data.getVar('PATCHTOOL', d, 1) or 'quilt'] diff --git a/conf/bitbake.conf b/conf/bitbake.conf index c4af34e8d7..c2f7666ef2 100644 --- a/conf/bitbake.conf +++ b/conf/bitbake.conf @@ -405,6 +405,7 @@ export RANLIB = "${HOST_PREFIX}ranlib" export STRIP = "${HOST_PREFIX}strip" export OBJCOPY = "${HOST_PREFIX}objcopy" export OBJDUMP = "${HOST_PREFIX}objdump" +export NM = "${HOST_PREFIX}nm" PYTHON = "${@sys.executable}" export BUILD_CC = "${CCACHE}${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}" diff --git a/conf/checksums.ini b/conf/checksums.ini index 85de9c2d93..ab8b320cb5 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -4982,6 +4982,10 @@ sha256=f1a6dea51be9798903a0543fb50f463b0594b1f11b897bc50e40825fb7527c61 md5=f92e5606c23a8092f3d5694e8d1c932e sha256=d3be5c6eec24950cb3bd67dbfbcdf036f1278fae5fd78655ef8cdf9e911e428a +[http://savannah.nongnu.org/download/dmidecode/dmidecode-2.10.tar.bz2] +md5=3c9c4d55a40b78600f3b43bfa64616f9 +sha256=4d74a3e93353320317a424816f9a045df06d9ed4b5b80881e16fdfcc74c9e2c0 + [http://savannah.nongnu.org/download/dmidecode/dmidecode-2.9.tar.bz2] md5=3dac4b1817012ffebd78671473d8f56c sha256=888eb2c25bdcef5ee34c38cd5cb0f491d7dd82029dc0f4ae96183a0088a5e015 @@ -14282,6 +14286,10 @@ sha256=c6629c4bed428f9df3f89efc065b2d96f05eba36286532ebe8b8e404022371a0 md5=d42110ae548dae1eea73e83b03a1a936 sha256=243311225a6bdcee065aaabc63334086cdd4298f13def45c7e798201f88d08cc +[ftp://ftp.musicbrainz.org/pub/musicbrainz/libmusicbrainz-3.0.2.tar.gz] +md5=648ecd43f7b80852419aaf73702bc23f +sha256=b9a35e56826239add731cf083108cbc313d4a2d1770e6f5006966daa66a21eda + [ftp://ftp.debian.org/debian/pool/main/libn/libnet0/libnet0_1.0.2a.orig.tar.gz] md5=bf4983ea440542f3ec019cc1bb6ca87d sha256=cf6bf75d590884fa9d0725d4d86afa93211e29cf0c5f333a60bb4e4eb347dc29 @@ -17758,6 +17766,10 @@ sha256=0d10d8f70a6fadfb9cfaa7b66c5fe7eba17e64ecb96104c4ddedc82f89765d5c md5=16187fed2bdefec6275ece6401ce4cd2 sha256=5dc783c412c4d1ff463c450d2a2f9e1ea53a43d9ba1dda92bbf5182f60db532f +[http://www.nano-editor.org/dist/v2.0/nano-2.0.9.tar.gz] +md5=2be94dc43fb60fff4626a2401a977220 +sha256=6d212385680d29dcda35dda7801da19c80182a8bc6bc6d5cf7533034c853d37f + [http://downloads.sourceforge.net/nasm/nasm-0.98.38.tar.bz2] md5=9f682490c132b070d54e395cb6ee145e sha256=87e64eff736196862ed46c04a3dffa612d765df980fa974fc65e026d811bd9d0 @@ -18710,6 +18722,10 @@ sha256=cb1452159036ba7d3003b75dfef38fcbc61503f76adfca2879ebf7766931cade md5=82b059379895cf125261d7d773465915 sha256=cb1452159036ba7d3003b75dfef38fcbc61503f76adfca2879ebf7766931cade +[http://downloads.sourceforge.net/oprofile/oprofile-0.9.5.tar.gz] +md5=4b2ceca3fa013c95cc8d47c790807dc2 +sha256=1cb7c3968e3e01e7597f54b87ebc87a48c6c8e569db7e353adb91841db5b4190 + [http://www.rpsys.net/openzaurus/patches/archive/oprofile_always_bt_arm-r0.patch] md5=9d1e6a9bd4d6dc9cae3c54c18c303ace sha256=e0e33fae512e54ff27474c926a758cf687e35d2c3007f69d4c647b69d47352ae @@ -23038,6 +23054,10 @@ sha256=763b8c9c16c03adc3ad00ccf1b5b47a08b5ffe94e499d3c87bb02acbc1026b53 md5=6f3701a0f2acf3fe53093491ba3d77ee sha256=88cf24ba5d589351791709ff7556ababc019ec59f3240ac2087dacabb9ad77be +[http://subversion.tigris.org/downloads/subversion-1.6.5.tar.bz2] +md5=1a53a0e72bee0bf814f4da83a9b6a636 +sha256=64331bda459e984b8d369b449eec89daa2f3cd288186f1d2a9ad8011badd4dad + [http://ftp.sudo.ws/sudo/dist/sudo-1.6.8p12.tar.gz] md5=b29893c06192df6230dd5f340f3badf5 sha256=56f7d86032538a4a98d90af3742903a09ba16d6db82b593e4a47605f87fa581a @@ -25374,10 +25394,18 @@ sha256=18b38aff8e019f35bfee810831535685e69dcf91283e50bc62efa82e3a8dbc21 md5=fc805051f0fe505c7a4b1b5c8db9b9e3 sha256=fa52aa629bb882335d45d67401d270c3f21b5131aaea005ac0d4590f2ce8b043 +[http://www.oligarchy.co.uk/xapian/1.0.14/xapian-bindings-1.0.14.tar.gz] +md5=d6f86ccc3d1a534902e1cf8df1cb43f3 +sha256=05072405fd182425d90374d2d5b69c36fe9fd927f44e397c449a9bdd1a971218 + [http://www.oligarchy.co.uk/xapian/1.0.13/xapian-core-1.0.13.tar.gz] md5=5442e7ffc75abd853d1ab1d12667a3e9 sha256=a474be06657bd83200231d938d48d4d2a83cff0252c618421f835604c5548dce +[http://www.oligarchy.co.uk/xapian/1.0.14/xapian-core-1.0.14.tar.gz] +md5=f318fe11143af82aa6679acc51723a1a +sha256=9db5a04e184bc06be17d007a58adbf2592e7a380dfd80ddc6aa9001084b9a134 + [http://www.oligarchy.co.uk/xapian/1.0.5/xapian-core-1.0.5.tar.gz] md5=5fbfec7f23b0f539d32b50de4a278b95 sha256=277e30cbd4a4d9355e9b2c02489d34cbaed87754bbdeb8956e5463e9fb592658 diff --git a/conf/machine/include/omap3.inc b/conf/machine/include/omap3.inc index 7d404a4f65..163c9c901a 100644 --- a/conf/machine/include/omap3.inc +++ b/conf/machine/include/omap3.inc @@ -1,7 +1,7 @@ require conf/machine/include/tune-cortexa8.inc PREFERRED_PROVIDER_virtual/kernel = "linux-omap" # Increase this everytime you change something in the kernel -MACHINE_KERNEL_PR = "r42" +MACHINE_KERNEL_PR = "r43" KERNEL_IMAGETYPE = "uImage" diff --git a/recipes/dmidecode/dmidecode_2.10.bb b/recipes/dmidecode/dmidecode_2.10.bb new file mode 100644 index 0000000000..d3a646dfd1 --- /dev/null +++ b/recipes/dmidecode/dmidecode_2.10.bb @@ -0,0 +1,12 @@ +DESCRIPTION = "DMI (Desktop Management Interface) table related utilities" +HOMEPAGE = "http://www.nongnu.org/dmidecode/" +LICENSE = "GPLv2" +PR = "r0" + +SRC_URI = "http://savannah.nongnu.org/download/dmidecode/${P}.tar.bz2" + +COMPATIBLE_HOST = "(i.86|x86_64).*-linux" + +do_install() { + oe_runmake DESTDIR="${D}" install +} diff --git a/recipes/ecj/libecj-bootstrap_3.5.bb b/recipes/ecj/libecj-bootstrap_3.5.bb index 1665b337b6..005000eb4b 100644 --- a/recipes/ecj/libecj-bootstrap_3.5.bb +++ b/recipes/ecj/libecj-bootstrap_3.5.bb @@ -1,3 +1,7 @@ +# Causes problems with openjdk/icedtea. See Eclipse bug eclipse bug #285466 +# Might get fixed in IcedTea 1.6 +DEFAULT_PREFERENCE = "-1" + require libecj-bootstrap.inc PR = "r0" diff --git a/recipes/gdb/gdb-canadian-sdk_6.8.bb b/recipes/gdb/gdb-canadian-sdk_6.8.bb index 1eefddc917..db45cfdf16 100644 --- a/recipes/gdb/gdb-canadian-sdk_6.8.bb +++ b/recipes/gdb/gdb-canadian-sdk_6.8.bb @@ -1,8 +1,10 @@ require gdb-canadian-cross.inc +LICENSE = "GPLv3" SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0 \ file://gdb-6.8-mingw-3.patch;patch=1 \ file://gdb-6.8-pr9638-ppc-canadian-configh.patch;patch=1 \ + file://gdb-6.8-fix-compile-karmic.patch;patch=1 \ file://gdb-6.8-mips-mingw-sim-fixup.patch;patch=1" PR = "r1" diff --git a/recipes/gdb/gdb-cross-sdk_6.8.bb b/recipes/gdb/gdb-cross-sdk_6.8.bb index 66e1454779..6d6fba7993 100644 --- a/recipes/gdb/gdb-cross-sdk_6.8.bb +++ b/recipes/gdb/gdb-cross-sdk_6.8.bb @@ -1,4 +1,5 @@ require gdb-cross.inc +LICENSE = "GPLv3" SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0 \ file://gdb-6.8-fix-compile-karmic.patch;patch=1" diff --git a/recipes/gdb/gdb-cross_6.8.bb b/recipes/gdb/gdb-cross_6.8.bb index 664ab5e323..2c24d4cac8 100644 --- a/recipes/gdb/gdb-cross_6.8.bb +++ b/recipes/gdb/gdb-cross_6.8.bb @@ -1,6 +1,8 @@ require gdb-cross.inc +LICENSE = "GPLv3" -SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0" +SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0 \ + file://gdb-6.8-fix-compile-karmic.patch;patch=1" inherit cross diff --git a/recipes/gnome/gnome-games_2.24.0.bb b/recipes/gnome/gnome-games_2.24.0.bb index cc795e14a5..6449c82c8a 100644 --- a/recipes/gnome/gnome-games_2.24.0.bb +++ b/recipes/gnome/gnome-games_2.24.0.bb @@ -24,7 +24,10 @@ do_configure_prepend() { do_configure_append() { for i in $(find ${S} -name "Makefile") ; do - sed -i -e s:'I/usr/include'::g -e s:'-I /usr/include -I /usr/local/include'::g $i + sed -i \ + -e s:'-I/usr/include/SDL':'-I${STAGING_INCDIR}/SDL':g \ + -e s:'-I/usr/local/include/SDL':'-I${STAGING_INCDIR}/SDL':g \ + $i done } diff --git a/recipes/linux/linux-2.6.24/hipox/defconfig b/recipes/linux/linux-2.6.24/hipox/defconfig index 62c6d16f6b..a1482fbf4b 100644 --- a/recipes/linux/linux-2.6.24/hipox/defconfig +++ b/recipes/linux/linux-2.6.24/hipox/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.24.4 -# Wed Jul 29 12:54:46 2009 +# Mon Aug 24 09:09:25 2009 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -48,7 +48,8 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_FAIR_GROUP_SCHED is not set CONFIG_SYSFS_DEPRECATED=y # CONFIG_RELAY is not set -# CONFIG_BLK_DEV_INITRD is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y # CONFIG_EMBEDDED is not set diff --git a/recipes/linux/linux-2.6.29/boc01/007-081217-lm73.patch b/recipes/linux/linux-2.6.29/boc01/007-090825-lm73.patch index ec2a4e40e8..8ffae6a2b0 100644 --- a/recipes/linux/linux-2.6.29/boc01/007-081217-lm73.patch +++ b/recipes/linux/linux-2.6.29/boc01/007-090825-lm73.patch @@ -1,7 +1,7 @@ Index: linux-2.6.29/drivers/hwmon/Kconfig =================================================================== ---- linux-2.6.29.orig/drivers/hwmon/Kconfig 2009-03-24 00:12:14.000000000 +0100 -+++ linux-2.6.29/drivers/hwmon/Kconfig 2009-04-01 17:37:50.000000000 +0200 +--- linux-2.6.29.orig/drivers/hwmon/Kconfig 2009-08-25 17:33:48.000000000 +0200 ++++ linux-2.6.29/drivers/hwmon/Kconfig 2009-08-25 17:34:24.000000000 +0200 @@ -448,6 +448,15 @@ This driver can also be built as a module. If so, the module will be called lm70. @@ -21,16 +21,18 @@ Index: linux-2.6.29/drivers/hwmon/Kconfig Index: linux-2.6.29/drivers/hwmon/lm73.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.29/drivers/hwmon/lm73.c 2009-04-01 17:37:50.000000000 +0200 -@@ -0,0 +1,232 @@ ++++ linux-2.6.29/drivers/hwmon/lm73.c 2009-08-25 18:43:49.000000000 +0200 +@@ -0,0 +1,243 @@ + /* + * LM73 Sensor driver + * Based on LM75 + * -+ * + * Copyright (C) 2007, CenoSYS (www.cenosys.com). -+ * Guillaume Ligneul -+ * Guillaume.ligneul@gmail.com ++ * Copyright (C) 2009, Bollore telecom (www.bolloretelecom.eu). ++ * ++ * Guillaume Ligneul (Guillaume.ligneul@gmail.com) ++ * Adrien Demarez <adrien.demarez@bolloretelecom.eu> ++ * Jeremy Laine <jeremy.laine@bolloretelecom.eu> + * + * This software program is licensed subject to the GNU General Public License + * (GPL).Version 2,June 1991, available at http://www.fsf.org/copyleft/gpl.html @@ -47,7 +49,7 @@ Index: linux-2.6.29/drivers/hwmon/lm73.c +#include <linux/mutex.h> + + -+/* Addresses to scan */ ++/* Addresses scanned */ +static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, + 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; + @@ -55,57 +57,44 @@ Index: linux-2.6.29/drivers/hwmon/lm73.c +I2C_CLIENT_INSMOD_1(lm73); + +/* LM73 registers */ -+#define LM73_REG_INPUT 0x00 +#define LM73_REG_CONF 0x01 -+#define LM73_REG_T_HIGH 0x02 -+#define LM73_REG_T_LOW 0x03 -+ +static const u8 LM73_REG_TEMP[3] = { -+ LM73_REG_INPUT, /* input */ -+ LM73_REG_T_HIGH, /* max */ -+ LM73_REG_T_LOW, /* min */ ++ 0x00, /* input */ ++ 0x02, /* max */ ++ 0x03, /* min */ +}; + +/* Each client has this additional data */ +struct lm73_data { -+ struct i2c_client client; -+ struct device *hwmon_dev; ++ struct device *hwmon_dev; + struct mutex update_lock; -+ char valid; /* !=0 if following fields are valid */ -+ unsigned long last_updated; /* In jiffies */ + u16 temp[3]; /* Register values, + 0 = input + 1 = max + 2 = min */ +}; + -+static int lm73_attach_adapter(struct i2c_adapter *adapter); -+static int lm73_detect(struct i2c_adapter *adapter, int address, int kind); -+static int lm73_detach_client(struct i2c_client *client); +static int lm73_read_value(struct i2c_client *client, u8 reg); +static int lm73_write_value(struct i2c_client *client, u8 reg, short value); + -+/* This is the driver that will be inserted */ -+static struct i2c_driver lm73_driver = { -+ .driver = { -+ .name = "lm73", -+ }, -+ .attach_adapter = lm73_attach_adapter, -+ .detach_client = lm73_detach_client, -+}; ++ ++/*-----------------------------------------------------------------------*/ ++ ++/* sysfs attributes for hwmon */ + +static ssize_t show_temp(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); ++ struct lm73_data *data = i2c_get_clientdata(client); + int iTemp = 0; + ++ mutex_lock(&data->update_lock); + iTemp = lm73_read_value(client, LM73_REG_TEMP[attr->index]); ++ mutex_unlock(&data->update_lock); + + return sprintf(buf, "%d\n", iTemp); -+ -+ +} + +static ssize_t set_temp(struct device *dev, struct device_attribute *da, @@ -113,11 +102,13 @@ Index: linux-2.6.29/drivers/hwmon/lm73.c +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); ++ struct lm73_data *data = i2c_get_clientdata(client); + int nr = attr->index; ++ long temp = simple_strtol(buf, NULL, 10); + -+ long tmp = simple_strtol(buf, NULL, 10); -+ -+ lm73_write_value(client, LM73_REG_TEMP[nr], tmp); ++ mutex_lock(&data->update_lock); ++ lm73_write_value(client, LM73_REG_TEMP[nr], temp); ++ mutex_unlock(&data->update_lock); + return count; +} + @@ -127,13 +118,6 @@ Index: linux-2.6.29/drivers/hwmon/lm73.c + show_temp, set_temp, 2); +static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL, 0); + -+static int lm73_attach_adapter(struct i2c_adapter *adapter) -+{ -+ if (!(adapter->class & I2C_CLASS_HWMON)) -+ return 0; -+ -+ return i2c_probe(adapter, &addr_data, lm73_detect); -+} + +static struct attribute *lm73_attributes[] = { + &sensor_dev_attr_temp1_input.dev_attr.attr, @@ -147,85 +131,111 @@ Index: linux-2.6.29/drivers/hwmon/lm73.c + .attrs = lm73_attributes, +}; + -+/* This function is called by i2c_probe */ -+static int lm73_detect(struct i2c_adapter *adapter, int address, int kind) -+{ -+ struct i2c_client *new_client; -+ struct lm73_data *data; -+ int err = 0; -+ const char *name = ""; ++/*-----------------------------------------------------------------------*/ + -+ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | -+ I2C_FUNC_SMBUS_WORD_DATA)) -+ goto exit; ++/* device probe and removal */ + -+ if (!(data = kzalloc(sizeof(struct lm73_data), GFP_KERNEL))) { -+ err = -ENOMEM; -+ goto exit; -+ } ++static int ++lm73_probe(struct i2c_client *client, const struct i2c_device_id *id) ++{ ++ struct lm73_data *data; ++ int status; + -+ new_client = &data->client; -+ i2c_set_clientdata(new_client, data); -+ new_client->addr = address; -+ new_client->adapter = adapter; -+ new_client->driver = &lm73_driver; -+ new_client->flags = 0; ++ if (!i2c_check_functionality(client->adapter, ++ I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) ++ return -EIO; + -+ name = "lm73"; ++ data = kzalloc(sizeof(struct lm73_data), GFP_KERNEL); ++ if (!data) ++ return -ENOMEM; + -+ /* Fill in the remaining client fields and put it into the global list */ -+ strlcpy(new_client->name, name, I2C_NAME_SIZE); -+ data->valid = 0; ++ i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + -+ /* Tell the I2C layer a new client has arrived */ -+ if ((err = i2c_attach_client(new_client))) -+ goto exit_free; -+ + /* Register sysfs hooks */ -+ if ((err = sysfs_create_group(&new_client->dev.kobj, &lm73_group))) -+ goto exit_detach; ++ status = sysfs_create_group(&client->dev.kobj, &lm73_group); ++ if (status) ++ goto exit_free; + -+ data->hwmon_dev = hwmon_device_register(&new_client->dev); ++ data->hwmon_dev = hwmon_device_register(&client->dev); + if (IS_ERR(data->hwmon_dev)) { -+ err = PTR_ERR(data->hwmon_dev); ++ status = PTR_ERR(data->hwmon_dev); + goto exit_remove; + } + ++ dev_info(&client->dev, "%s: sensor '%s'\n", ++ dev_name(data->hwmon_dev), client->name); ++ + return 0; + +exit_remove: -+ sysfs_remove_group(&new_client->dev.kobj, &lm73_group); -+exit_detach: -+ i2c_detach_client(new_client); ++ sysfs_remove_group(&client->dev.kobj, &lm73_group); +exit_free: ++ i2c_set_clientdata(client, NULL); + kfree(data); -+exit: -+ return err; ++ return status; +} + -+static int lm73_detach_client(struct i2c_client *client) ++static int lm73_remove(struct i2c_client *client) +{ + struct lm73_data *data = i2c_get_clientdata(client); ++ + hwmon_device_unregister(data->hwmon_dev); + sysfs_remove_group(&client->dev.kobj, &lm73_group); -+ i2c_detach_client(client); ++ i2c_set_clientdata(client, NULL); + k |
