summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-11-09 10:55:04 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-11-09 10:55:04 +0100
commitb2cc1d18f57f8af42347a4b7a05afcc7e3e6d66d (patch)
treec7bf18bd3f6eef491dd62d383f836e4536c811cb
parentac9c1beb361e3c71e0b9b59d38e5022f12c263c6 (diff)
parent459bf1fd31da2c091c6c1e3a7e0f6a1b1cbf588b (diff)
downloadbarebox-b2cc1d18f57f8af42347a4b7a05afcc7e3e6d66d.tar.gz
barebox-b2cc1d18f57f8af42347a4b7a05afcc7e3e6d66d.tar.xz
Merge branch 'for-next/misc'
-rw-r--r--Makefile2
-rw-r--r--commands/mem.c3
-rw-r--r--commands/miitool.c2
-rw-r--r--common/Kconfig1
-rw-r--r--common/partitions/efi.c2
-rw-r--r--common/state/state.c3
-rw-r--r--common/state/state_variables.c6
-rw-r--r--drivers/aiodev/lm75.c10
-rw-r--r--drivers/clk/rockchip/clk-pll.c3
-rw-r--r--drivers/eeprom/at24.c9
-rw-r--r--drivers/gpio/gpio-pca953x.c8
-rw-r--r--drivers/gpio/gpio-sx150x.c8
-rw-r--r--drivers/i2c/muxes/i2c-mux-pca954x.c8
-rw-r--r--drivers/input/qt1070.c9
-rw-r--r--drivers/mfd/act8846.c10
-rw-r--r--drivers/mfd/da9053.c10
-rw-r--r--drivers/mfd/da9063.c9
-rw-r--r--drivers/mfd/lp3972.c10
-rw-r--r--drivers/mfd/mc34704.c9
-rw-r--r--drivers/mfd/mc9sdz60.c10
-rw-r--r--drivers/mfd/stmpe-i2c.c10
-rw-r--r--drivers/mfd/twl4030.c10
-rw-r--r--drivers/mfd/twl6030.c10
-rw-r--r--drivers/net/designware.c10
-rw-r--r--drivers/net/phy/phy.c4
-rw-r--r--drivers/of/base.c2
-rw-r--r--drivers/pinctrl/pinctrl-at91.c4
-rw-r--r--drivers/rtc/rtc-abracon.c8
-rw-r--r--drivers/rtc/rtc-ds1307.c9
-rw-r--r--drivers/video/mtl017.c10
-rw-r--r--drivers/video/rave-sp-backlight.c1
-rw-r--r--drivers/video/ssd1307fb.c10
-rw-r--r--drivers/video/tc358767.c8
-rw-r--r--include/dhcp.h1
-rw-r--r--include/i2c/i2c.h4
-rw-r--r--net/dhcp.c6
36 files changed, 59 insertions, 180 deletions
diff --git a/Makefile b/Makefile
index 60a5d5ce11..10e1b74a6d 100644
--- a/Makefile
+++ b/Makefile
@@ -807,7 +807,7 @@ PHONY += prepare-all
# 1) Check that make has not been executed in the kernel src $(srctree)
prepare3: include/config/kernel.release
ifneq ($(KBUILD_SRC),)
- @echo ' Using $(srctree) as source for kernel'
+ @echo ' Using $(srctree) as source for barebox'
$(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
echo " $(srctree) is not clean, please run 'make mrproper'";\
echo " in the '$(srctree)' directory.";\
diff --git a/commands/mem.c b/commands/mem.c
index eb91ade05a..cdd7a492d0 100644
--- a/commands/mem.c
+++ b/commands/mem.c
@@ -96,7 +96,8 @@ static int mem_probe(struct device_d *dev)
dev->priv = cdev;
cdev->name = (char*)dev->resource[0].name;
- cdev->size = (unsigned long)resource_size(&dev->resource[0]);
+ cdev->size = min(resource_size(&dev->resource[0]),
+ (unsigned long long)S64_MAX);
cdev->ops = &memops;
cdev->dev = dev;
diff --git a/commands/miitool.c b/commands/miitool.c
index dea4f853ce..acf61421b8 100644
--- a/commands/miitool.c
+++ b/commands/miitool.c
@@ -115,7 +115,7 @@ static int show_basic_mii(struct mii_bus *mii, struct phy_device *phydev,
for (i = 0; i < 32; i++)
mii_val[i] = mii->read(mii, phydev->addr, i);
- printf((mii->parent->id) < 0 ? "%s: %s:" : "%s: %s%d: ",
+ printf((mii->parent->id) < 0 ? "%s: %s: " : "%s: %s%d: ",
phydev->cdev.name, mii->parent->name, mii->parent->id);
diff --git a/common/Kconfig b/common/Kconfig
index 4909c82322..eddd99ea3b 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -653,7 +653,6 @@ config BOOTM_FORCE_SIGNED_IMAGES
since they are the only supported image type that support signing.
config BLSPEC
- depends on BLOCK
depends on FLEXIBLE_BOOTARGS
depends on !SHELL_NONE
select BOOT
diff --git a/common/partitions/efi.c b/common/partitions/efi.c
index 88734f166b..3c1077fd0c 100644
--- a/common/partitions/efi.c
+++ b/common/partitions/efi.c
@@ -23,7 +23,7 @@
#include "efi.h"
#include "parser.h"
-static int force_gpt = IS_ENABLED(CONFIG_PARTITION_DISK_EFI_GPT_NO_FORCE);
+static const int force_gpt = IS_ENABLED(CONFIG_PARTITION_DISK_EFI_GPT_NO_FORCE);
/**
* efi_crc32() - EFI version of crc32 function
diff --git a/common/state/state.c b/common/state/state.c
index 25d9502111..089d8f50d5 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -311,7 +311,7 @@ static int state_convert_node_variable(struct state *state,
if ((conv == STATE_CONVERT_TO_NODE)
|| (conv == STATE_CONVERT_FIXUP)) {
ret = of_property_write_string(new_node, "type",
- vtype->type_name);
+ vtype->type_name);
if (ret)
goto out;
@@ -583,6 +583,7 @@ void state_release(struct state *state)
/*
* state_new_from_node - create a new state instance from a device_node
*
+ * @node The device_node describing the new state instance
* @readonly This is a read-only state. Note that with this option set,
* there are no repairs done.
*/
diff --git a/common/state/state_variables.c b/common/state/state_variables.c
index de9ba4ab61..abd714ceda 100644
--- a/common/state/state_variables.c
+++ b/common/state/state_variables.c
@@ -339,8 +339,7 @@ static int state_string_export(struct state_variable *var,
int ret = 0;
if (string->value_default) {
- ret = of_set_property(node, "default", string->value_default,
- strlen(string->value_default) + 1, 1);
+ ret = of_property_write_string(node, "default", string->value_default);
if (ret)
return ret;
@@ -350,8 +349,7 @@ static int state_string_export(struct state_variable *var,
return 0;
if (string->value)
- ret = of_set_property(node, "value", string->value,
- strlen(string->value) + 1, 1);
+ ret = of_property_write_string(node, "value", string->value);
return ret;
}
diff --git a/drivers/aiodev/lm75.c b/drivers/aiodev/lm75.c
index b4da5a0f75..af54227e40 100644
--- a/drivers/aiodev/lm75.c
+++ b/drivers/aiodev/lm75.c
@@ -19,7 +19,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <i2c/i2c.h>
@@ -252,11 +251,4 @@ static struct driver_d lm75_driver = {
.probe = lm75_probe,
.id_table = lm75_ids,
};
-
-static int lm75_init(void)
-{
- i2c_driver_register(&lm75_driver);
- return 0;
-}
-
-device_initcall(lm75_init);
+device_i2c_driver(lm75_driver);
diff --git a/drivers/clk/rockchip/clk-pll.c b/drivers/clk/rockchip/clk-pll.c
index f0dc12091b..87a3969c28 100644
--- a/drivers/clk/rockchip/clk-pll.c
+++ b/drivers/clk/rockchip/clk-pll.c
@@ -164,6 +164,9 @@ static int rockchip_rk3066_pll_set_rate(struct clk *hw, unsigned long drate,
int cur_parent;
int ret;
+ if (old_rate == drate)
+ return 0;
+
pr_debug("%s: changing %s from %lu to %lu with a parent rate of %lu\n",
__func__, __clk_get_name(hw), old_rate, drate, prate);
diff --git a/drivers/eeprom/at24.c b/drivers/eeprom/at24.c
index 4fae3a12e4..e79031a2d3 100644
--- a/drivers/eeprom/at24.c
+++ b/drivers/eeprom/at24.c
@@ -11,7 +11,6 @@
*/
#include <common.h>
-#include <init.h>
#include <malloc.h>
#include <clock.h>
#include <driver.h>
@@ -529,10 +528,4 @@ static struct driver_d at24_driver = {
.probe = at24_probe,
.id_table = at24_ids,
};
-
-static int at24_init(void)
-{
- i2c_driver_register(&at24_driver);
- return 0;
-}
-device_initcall(at24_init);
+device_i2c_driver(at24_driver);
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 53e8c7650d..98a7a6c97c 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -14,7 +14,6 @@
*/
#include <common.h>
-#include <init.h>
#include <malloc.h>
#include <driver.h>
#include <xfuncs.h>
@@ -508,9 +507,4 @@ static struct driver_d pca953x_driver = {
.of_compatible = DRV_OF_COMPAT(pca953x_dt_ids),
.id_table = pca953x_id,
};
-
-static int __init pca953x_init(void)
-{
- return i2c_driver_register(&pca953x_driver);
-}
-device_initcall(pca953x_init);
+device_i2c_driver(pca953x_driver);
diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c
index 7b8cfb5042..76535187b0 100644
--- a/drivers/gpio/gpio-sx150x.c
+++ b/drivers/gpio/gpio-sx150x.c
@@ -17,7 +17,6 @@
*/
#include <common.h>
-#include <init.h>
#include <malloc.h>
#include <driver.h>
#include <xfuncs.h>
@@ -266,9 +265,4 @@ static struct driver_d sx150x_driver = {
.probe = sx150x_probe,
.of_compatible = sx150x_dt_ids,
};
-
-static int __init sx150x_init(void)
-{
- return i2c_driver_register(&sx150x_driver);
-}
-device_initcall(sx150x_init);
+device_i2c_driver(sx150x_driver);
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 395254cdca..d397e803b1 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -44,7 +44,6 @@
#include <i2c/i2c.h>
#include <i2c/i2c-algo-bit.h>
#include <i2c/i2c-mux.h>
-#include <init.h>
#include <gpio.h>
#include <of_gpio.h>
@@ -248,12 +247,7 @@ static struct driver_d pca954x_driver = {
.probe = pca954x_probe,
.id_table = pca954x_id,
};
-
-static int __init pca954x_init(void)
-{
- return i2c_driver_register(&pca954x_driver);
-}
-device_initcall(pca954x_init);
+device_i2c_driver(pca954x_driver);
MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>");
MODULE_DESCRIPTION("PCA954x I2C mux/switch driver");
diff --git a/drivers/input/qt1070.c b/drivers/input/qt1070.c
index d81a8fa401..59acee5c39 100644
--- a/drivers/input/qt1070.c
+++ b/drivers/input/qt1070.c
@@ -6,7 +6,6 @@
#include <common.h>
#include <errno.h>
-#include <init.h>
#include <clock.h>
#include <poller.h>
#include <kfifo.h>
@@ -284,10 +283,4 @@ static struct driver_d qt1070_driver = {
.name = "qt1070",
.probe = qt1070_probe,
};
-
-static int qt1070_init(void)
-{
- i2c_driver_register(&qt1070_driver);
- return 0;
-}
-device_initcall(qt1070_init);
+device_i2c_driver(qt1070_driver);
diff --git a/drivers/mfd/act8846.c b/drivers/mfd/act8846.c
index dfca0498b1..53ab70f5cc 100644
--- a/drivers/mfd/act8846.c
+++ b/drivers/mfd/act8846.c
@@ -18,7 +18,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
@@ -144,11 +143,4 @@ static struct driver_d act8846_driver = {
.name = DRIVERNAME,
.probe = act8846_probe,
};
-
-static int act8846_init(void)
-{
- i2c_driver_register(&act8846_driver);
- return 0;
-}
-
-device_initcall(act8846_init);
+device_i2c_driver(act8846_driver);
diff --git a/drivers/mfd/da9053.c b/drivers/mfd/da9053.c
index c706082a8b..b156bf113f 100644
--- a/drivers/mfd/da9053.c
+++ b/drivers/mfd/da9053.c
@@ -15,7 +15,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
@@ -310,11 +309,4 @@ static struct driver_d da9053_driver = {
.probe = da9053_probe,
.of_compatible = DRV_OF_COMPAT(da9053_dt_ids),
};
-
-static int da9053_init(void)
-{
- i2c_driver_register(&da9053_driver);
- return 0;
-}
-
-device_initcall(da9053_init);
+device_i2c_driver(da9053_driver);
diff --git a/drivers/mfd/da9063.c b/drivers/mfd/da9063.c
index 0c27bf495f..b6114a614b 100644
--- a/drivers/mfd/da9063.c
+++ b/drivers/mfd/da9063.c
@@ -16,7 +16,6 @@
#include <common.h>
#include <driver.h>
#include <restart.h>
-#include <init.h>
#include <i2c/i2c.h>
#include <malloc.h>
#include <notifier.h>
@@ -297,10 +296,4 @@ static struct driver_d da9063_driver = {
.id_table = da9063_id,
.of_compatible = DRV_OF_COMPAT(da906x_dt_ids),
};
-
-static int da9063_init(void)
-{
- return i2c_driver_register(&da9063_driver);
-}
-
-device_initcall(da9063_init);
+device_i2c_driver(da9063_driver);
diff --git a/drivers/mfd/lp3972.c b/drivers/mfd/lp3972.c
index 054713b942..42b28070ad 100644
--- a/drivers/mfd/lp3972.c
+++ b/drivers/mfd/lp3972.c
@@ -17,7 +17,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
@@ -96,11 +95,4 @@ static struct driver_d lp_driver = {
.name = DRIVERNAME,
.probe = lp_probe,
};
-
-static int lp_init(void)
-{
- i2c_driver_register(&lp_driver);
- return 0;
-}
-
-device_initcall(lp_init);
+device_i2c_driver(lp_driver);
diff --git a/drivers/mfd/mc34704.c b/drivers/mfd/mc34704.c
index bfda169aaa..f15f37ef6e 100644
--- a/drivers/mfd/mc34704.c
+++ b/drivers/mfd/mc34704.c
@@ -17,7 +17,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
@@ -133,10 +132,4 @@ static struct driver_d mc34704_driver = {
.probe = mc34704_probe,
.of_compatible = DRV_OF_COMPAT(mc34704_dt_ids),
};
-
-static int mc34704_init(void)
-{
- i2c_driver_register(&mc34704_driver);
- return 0;
-}
-device_initcall(mc34704_init);
+device_i2c_driver(mc34704_driver);
diff --git a/drivers/mfd/mc9sdz60.c b/drivers/mfd/mc9sdz60.c
index 9993efc5de..2cb38d9784 100644
--- a/drivers/mfd/mc9sdz60.c
+++ b/drivers/mfd/mc9sdz60.c
@@ -16,7 +16,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
@@ -139,11 +138,4 @@ static struct driver_d mc_driver = {
.name = DRIVERNAME,
.probe = mc_probe,
};
-
-static int mc_init(void)
-{
- i2c_driver_register(&mc_driver);
- return 0;
-}
-
-device_initcall(mc_init);
+device_i2c_driver(mc_driver);
diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c
index 51c56bbf56..084e4b43bb 100644
--- a/drivers/mfd/stmpe-i2c.c
+++ b/drivers/mfd/stmpe-i2c.c
@@ -15,7 +15,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
@@ -173,11 +172,4 @@ static struct driver_d stmpe_driver = {
.probe = stmpe_probe,
.id_table = stmpe_i2c_id,
};
-
-static int stmpe_init(void)
-{
- i2c_driver_register(&stmpe_driver);
- return 0;
-}
-
-device_initcall(stmpe_init);
+device_i2c_driver(stmpe_driver);
diff --git a/drivers/mfd/twl4030.c b/drivers/mfd/twl4030.c
index 3b4c661a87..cf33efbd89 100644
--- a/drivers/mfd/twl4030.c
+++ b/drivers/mfd/twl4030.c
@@ -6,7 +6,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
@@ -50,11 +49,4 @@ static struct driver_d twl_driver = {
.name = DRIVERNAME,
.probe = twl_probe,
};
-
-static int twl_init(void)
-{
- i2c_driver_register(&twl_driver);
- return 0;
-}
-
-device_initcall(twl_init);
+device_i2c_driver(twl_driver);
diff --git a/drivers/mfd/twl6030.c b/drivers/mfd/twl6030.c
index 0645d3c4db..0a244de077 100644
--- a/drivers/mfd/twl6030.c
+++ b/drivers/mfd/twl6030.c
@@ -5,7 +5,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
@@ -67,11 +66,4 @@ static struct driver_d twl_driver = {
.name = DRIVERNAME,
.probe = twl_probe,
};
-
-static int twl_init(void)
-{
- i2c_driver_register(&twl_driver);
- return 0;
-}
-
-device_initcall(twl_init);
+device_i2c_driver(twl_driver);
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 49ddaa20d8..58880b0e52 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -408,12 +408,22 @@ static void dwc_version(struct device_d *dev, u32 hwid)
static int dwc_probe_dt(struct device_d *dev, struct dw_eth_dev *priv)
{
+ struct device_node *child;
+
if (!IS_ENABLED(CONFIG_OFTREE))
return -ENODEV;
priv->phy_addr = -1;
priv->interface = of_get_phy_mode(dev->device_node);
+ /* Set MDIO bus device node, if present. */
+ for_each_child_of_node(dev->device_node, child) {
+ if (of_device_is_compatible(child, "snps,dwmac-mdio")) {
+ priv->miibus.dev.device_node = child;
+ break;
+ }
+ }
+
return 0;
}
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 42dcad9069..63f249fcff 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -398,6 +398,10 @@ static int phy_device_attach(struct phy_device *phy, struct eth_device *edev,
phy->adjust_link = adjust_link;
+ /* If the phy is a fixed-link, then call adjust_link directly */
+ if (!phy->bus && adjust_link)
+ adjust_link(edev);
+
return 0;
}
diff --git a/drivers/of/base.c b/drivers/of/base.c
index fc01a99ef2..0d8289d5fa 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1235,7 +1235,7 @@ int of_property_write_u64_array(struct device_node *np,
*
* @np: device node to which the property value is to be written.
* @propname: name of the property to be written.
- * value: pointer to the string to write
+ * @value: pointer to the string to write
*
* Search for a property in a device node and write a string to
* it. If the property does not exist, it will be created and appended to
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 84348a0530..3201eb9cb1 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -510,7 +510,7 @@ static int at91_pinctrl_probe(struct device_d *dev)
if (ret)
return ret;
- dev_info(dev, "AT91 pinctrl registered\n");
+ dev_dbg(dev, "AT91 pinctrl registered\n");
return 0;
}
@@ -690,7 +690,7 @@ static int at91_gpio_probe(struct device_d *dev)
return ret;
}
- dev_info(dev, "AT91 gpio driver registered\n");
+ dev_dbg(dev, "AT91 gpio driver registered\n");
return 0;
}
diff --git a/drivers/rtc/rtc-abracon.c b/drivers/rtc/rtc-abracon.c
index 02de2f1063..571909bf71 100644
--- a/drivers/rtc/rtc-abracon.c
+++ b/drivers/rtc/rtc-abracon.c
@@ -10,7 +10,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
@@ -118,9 +117,4 @@ static struct driver_d abracon_driver = {
.probe = abracon_probe,
.id_table = abracon_id,
};
-
-static int __init abracon_init(void)
-{
- return i2c_driver_register(&abracon_driver);
-}
-device_initcall(abracon_init);
+device_i2c_driver(abracon_driver);
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 73d88ba6f2..bb597305e5 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -14,7 +14,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <malloc.h>
@@ -112,6 +111,7 @@ static struct platform_device_id ds1307_id[] = {
{ "ds1308", ds_1338 }, /* Difference 1308 to 1338 irrelevant */
{ "ds1338", ds_1338 },
{ "ds1341", ds_1341 },
+ { "ds3231", ds_1337 },
{ "pt7c4338", ds_1307 },
{ }
};
@@ -489,9 +489,4 @@ static struct driver_d ds1307_driver = {
.probe = ds1307_probe,
.id_table = ds1307_id,
};
-
-static int __init ds1307_init(void)
-{
- return i2c_driver_register(&ds1307_driver);
-}
-device_initcall(ds1307_init);
+device_i2c_driver(ds1307_driver);
diff --git a/drivers/video/mtl017.c b/drivers/video/mtl017.c
index 1a1f686223..085ea110ba 100644
--- a/drivers/video/mtl017.c
+++ b/drivers/video/mtl017.c
@@ -16,7 +16,6 @@
*
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
@@ -270,11 +269,4 @@ static struct driver_d twl_driver = {
.name = "mtl017",
.probe = mtl017_probe,
};
-
-static int mtl017_init(void)
-{
- i2c_driver_register(&twl_driver);
- return 0;
-}
-
-device_initcall(mtl017_init);
+device_i2c_driver(twl_driver);
diff --git a/drivers/video/rave-sp-backlight.c b/drivers/video/rave-sp-backlight.c
index 88ec86e730..3a20def661 100644
--- a/drivers/video/rave-sp-backlight.c
+++ b/drivers/video/rave-sp-backlight.c
@@ -46,6 +46,7 @@ static int rave_sp_backlight_probe(struct device_d *dev)
bd = xzalloc(sizeof(*bd));
bd->dev.priv = dev->parent->priv;
+ bd->dev.parent = dev;
bd->brightness_default = 50;
bd->brightness_max = 100;
bd->brightness_set = rave_sp_backlight_set;
diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c
index 54e02e7220..d68f0c5056 100644
--- a/drivers/video/ssd1307fb.c
+++ b/drivers/video/ssd1307fb.c
@@ -18,7 +18,6 @@
*/
#include <common.h>
-#include <init.h>
#include <fb.h>
#include <i2c/i2c.h>
#include <of_device.h>
@@ -581,11 +580,4 @@ static struct driver_d ssd1307fb_driver = {
.probe = ssd1307fb_probe,
.of_compatible = DRV_OF_COMPAT(ssd1307fb_of_match),
};
-
-static int ssd1307_init(void)
-{
- i2c_driver_register(&ssd1307fb_driver);
- return 0;
-}
-
-device_initcall(ssd1307_init);
+device_i2c_driver(ssd1307fb_driver);
diff --git a/drivers/video/tc358767.c b/drivers/video/tc358767.c
index 125e8236c1..e64dde1ddf 100644
--- a/drivers/video/tc358767.c
+++ b/drivers/video/tc358767.c
@@ -20,7 +20,6 @@
*/
#include <common.h>
-#include <init.h>
#include <driver.h>
#include <malloc.h>
#include <errno.h>
@@ -1434,9 +1433,4 @@ static struct driver_d tc_driver = {
.name = "tc358767",
.probe = tc_probe,
};
-
-static int tc_init(void)
-{
- return i2c_driver_register(&tc_driver);
-}
-device_initcall(tc_init);
+device_i2c_driver(tc_driver);
diff --git a/include/dhcp.h b/include/dhcp.h
index ce5ed61c65..0dced8e9fa 100644
--- a/include/dhcp.h
+++ b/include/dhcp.h
@@ -28,6 +28,7 @@ struct dhcp_result {
IPaddr_t gateway;
IPaddr_t nameserver;
IPaddr_t serverip;
+ IPaddr_t dhcp_serverip;
char *hostname;
char *domainname;
char *rootpath;
diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
index cf784ca1f1..17b507ca22 100644
--- a/include/i2c/i2c.h
+++ b/include/i2c/i2c.h
@@ -17,6 +17,7 @@
#define I2C_I2C_H
#include <driver.h>
+#include <init.h>
#include <linux/types.h>
struct i2c_adapter;
@@ -297,4 +298,7 @@ static inline int i2c_driver_register(struct driver_d *drv)
return register_driver(drv);
}
+#define device_i2c_driver(drv) \
+ register_driver_macro(device, i2c, drv)
+
#endif /* I2C_I2C_H */
diff --git a/net/dhcp.c b/net/dhcp.c
index 427d80a5a8..79aa75d878 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -300,7 +300,7 @@ static void dhcp_options_handle(unsigned char option, void *popt,
net_copy_uint32(&dhcp_result->leasetime, popt);
break;
case 54:
- dhcp_result->serverip = net_read_ip(popt);
+ dhcp_result->dhcp_serverip = net_read_ip(popt);
break;
case 66:
dhcp_result->tftp_server_name = xstrndup(popt, optlen);
@@ -378,8 +378,8 @@ static void dhcp_send_request_packet(struct bootp *bp_offer)
/*
* Copy options from OFFER packet if present
*/
- extlen = dhcp_extended(bp->bp_vend, DHCP_REQUEST, dhcp_result->serverip,
- dhcp_result->ip);
+ extlen = dhcp_extended(bp->bp_vend, DHCP_REQUEST,
+ dhcp_result->dhcp_serverip, dhcp_result->ip);
debug("Transmitting DHCPREQUEST packet\n");
net_udp_send(dhcp_con, sizeof(*bp) + extlen);