b/arch/arm/mach-tegra/tegra2_emc.c
@@ -181,7 +181,7 @@ int tegra_emc_set_rate(unsigned long rate)
#ifdef CONFIG_OF
static struct device_node *tegra_emc_ramcode_devnode(struct device_node
*np)
{
- struct device_node *iter;
+ struct device_node *iter = NULL;
u32 reg;
for_each_child_of_node(np, iter) {
@@ -198,7 +198,7 @@ static struct tegra_emc_pdata *tegra_emc_dt_parse_pdata(
struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
- struct device_node *tnp, *iter;
+ struct device_node *tnp, *iter = NULL;
struct tegra_emc_pdata *pdata;
int ret, i, num_tables;
@@ -99,7 +99,7 @@ static void __init get_cpuinfo(void)
unsigned long core_khz;
u64 tmp;
struct cpuinfo_c6x *p;
- struct device_node *node, *np;
+ struct device_node *node, *np = NULL;
p = &per_cpu(cpu_data, smp_processor_id());
@@ -180,7 +180,7 @@ static int ibmebus_create_device(struct device_node *dn)
static int ibmebus_create_devices(const struct of_device_id *matches)
{
- struct device_node *root, *child;
+ struct device_node *root, *child = NULL;
int ret = 0;
root = of_find_node_by_path("/");
b/arch/powerpc/kernel/pci_of_scan.c
@@ -302,7 +302,7 @@ EXPORT_SYMBOL(of_scan_pci_bridge);
static void __devinit __of_scan_bus(struct device_node *node,
struct pci_bus *bus, int
rescan_existing)
{
- struct device_node *child;
+ struct device_node *child = NULL;
const u32 *reg;
int reglen, devfn;
struct pci_dev *dev;
@@ -735,7 +735,7 @@ void __init early_init_devtree(void *params)
*/
struct device_node *of_find_next_cache_node(struct device_node *np)
{
- struct device_node *child;
+ struct device_node *child = NULL;
const phandle *handle;
handle = of_get_property(np, "l2-cache", NULL);
@@ -255,7 +255,7 @@ int __devinit rtas_setup_phb(struct pci_controller *phb)
void __init find_and_init_phbs(void)
{
- struct device_node *node;
+ struct device_node *node = NULL;
struct pci_controller *phb;
struct device_node *root = of_find_node_by_path("/");
@@ -116,7 +116,7 @@ static int vio_cmo_num_OF_devs(void)
*/
node_vroot = of_find_node_by_name(NULL, "vdevice");
if (node_vroot) {
- struct device_node *of_node;
+ struct device_node *of_node = NULL;
struct property *prop;
for_each_child_of_node(node_vroot, of_node) {
b/arch/powerpc/platforms/44x/warp.c
@@ -172,7 +172,7 @@ static irqreturn_t temp_isr(int irq, void *context)
static int pika_setup_leds(void)
{
- struct device_node *np, *child;
+ struct device_node *np, *child = NULL;
np = of_find_compatible_node(NULL, NULL, "gpio-leds");
if (!np) {
b/arch/powerpc/platforms/cell/setup.c
@@ -155,7 +155,7 @@ static const struct of_device_id cell_bus_ids[]
__initconst = {
static int __init cell_publish_devices(void)
{
struct device_node *root = of_find_node_by_path("/");
- struct device_node *np;
+ struct device_node *np = NULL;
int node;
/* Publish OF platform devices for southbridge IOs */
b/arch/powerpc/platforms/powernv/opal.c
@@ -279,7 +279,7 @@ static irqreturn_t opal_interrupt(int irq, void *data)
static int __init opal_init(void)
{
- struct device_node *np, *consoles;
+ struct device_node *np = NULL, *consoles;
const u32 *irqs;
int rc, i, irqlen;
b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1317,7 +1317,7 @@ void __init pnv_pci_init_ioda1_phb(struct device_node
*np)
void __init pnv_pci_init_ioda_hub(struct device_node *np)
{
- struct device_node *phbn;
+ struct device_node *phbn = NULL;
const u64 *prop64;
u64 hub_id;
b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
@@ -175,7 +175,7 @@ static void __init pnv_pci_init_p5ioc2_phb(struct
device_node *np,
void __init pnv_pci_init_p5ioc2_hub(struct device_node *np)
{
- struct device_node *phbn;
+ struct device_node *phbn = NULL;
const u64 *prop64;
u64 hub_id;
void *tce_mem;
b/arch/powerpc/platforms/pseries/eeh.c
@@ -206,7 +206,7 @@ static size_t eeh_gather_pci_data(struct eeh_dev *edev,
char * buf, size_t len)
/* Gather status on devices under the bridge */
if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
- struct device_node *child;
+ struct device_node *child = NULL;
for_each_child_of_node(dn, child) {
if (of_node_to_eeh_dev(child))
@@ -289,7 +289,7 @@ struct device_node *eeh_find_device_pe(struct
device_node *dn)
*/
static void __eeh_mark_slot(struct device_node *parent, int mode_flag)
{
- struct device_node *dn;
+ struct device_node *dn = NULL;
for_each_child_of_node(parent, dn) {
if (of_node_to_eeh_dev(dn)) {
@@ -342,7 +342,7 @@ void eeh_mark_slot(struct device_node *dn, int
mode_flag)
*/
static void __eeh_clear_slot(struct device_node *parent, int mode_flag)
{
- struct device_node *dn;
+ struct device_node *dn = NULL;
for_each_child_of_node(parent, dn) {
if (of_node_to_eeh_dev(dn)) {
@@ -601,7 +601,7 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev,
enum pcie_reset_state stat
*/
void __eeh_set_pe_freset(struct device_node *parent, unsigned int *freset)
{
- struct device_node *dn;
+ struct device_node *dn = NULL;
for_each_child_of_node(parent, dn) {
if (of_node_to_eeh_dev(dn)) {
@@ -788,7 +788,7 @@ static inline void eeh_restore_one_device_bars(struct
eeh_dev *edev)
*/
void eeh_restore_bars(struct eeh_dev *edev)
{
- struct device_node *dn;
+ struct device_node *dn = NULL;
if (!edev)
return;
@@ -1050,7 +1050,7 @@ static void eeh_add_device_early(struct device_node
*dn)
*/
void eeh_add_device_tree_early(struct device_node *dn)
{
- struct device_node *sib;
+ struct device_node *sib = NULL;
for_each_child_of_node(dn, sib)
eeh_add_device_tree_early(sib);
b/arch/powerpc/sysdev/mv64x60_dev.c
@@ -430,7 +430,7 @@ error:
static int __init mv64x60_device_setup(void)
{
- struct device_node *np, *np2;
+ struct device_node *np, *np2 = NULL;
struct platform_device *pdev;
int id, id2;
int err;
@@ -1327,7 +1327,7 @@ static void fsl_dma_chan_remove(struct fsldma_chan
*chan)
static int __devinit fsldma_of_probe(struct platform_device *op)
{
struct fsldma_device *fdev;
- struct device_node *child;
+ struct device_node *child = NULL;
int err;
fdev = kzalloc(sizeof(*fdev), GFP_KERNEL);
b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -145,7 +145,7 @@ nouveau_connector_of_detect(struct drm_connector
*connector)
struct drm_device *dev = connector->dev;
struct nouveau_connector *nv_connector =
nouveau_connector(connector);
struct nouveau_encoder *nv_encoder;
- struct device_node *cn, *dn = pci_device_to_OF_node(dev->pdev);
+ struct device_node *cn = NULL, *dn =
pci_device_to_OF_node(dev->pdev);
if (!dn ||
!((nv_encoder = find_encoder(connector, OUTPUT_TMDS)) ||
@@ -164,7 +164,7 @@ static int ads1015_remove(struct i2c_client *client)
static int ads1015_get_channels_config_of(struct i2c_client *client)
{
struct ads1015_data *data = i2c_get_clientdata(client);
- struct device_node *node;
+ struct device_node *node = NULL;
if (!client->dev.of_node
|| !of_get_next_child(client->dev.of_node, NULL))
b/drivers/i2c/busses/i2c-powermac.c
@@ -340,7 +340,7 @@ static void __devinit
i2c_powermac_register_devices(struct i2c_adapter *adap,
struct pmac_i2c_bus
*bus)
{
struct i2c_client *newdev;
- struct device_node *node;
+ struct device_node *node = NULL;
bool found_onyx = 0;
/*
b/drivers/i2c/busses/i2c-pxa-pci.c
@@ -22,7 +22,7 @@ static struct platform_device *add_i2c_device(struct
pci_dev *dev, int bar)
struct platform_device *pdev;
struct i2c_pxa_platform_data pdata;
struct resource res[2];
- struct device_node *child;
+ struct device_node *child = NULL;
static int devnum;
int ret;
@@ -132,7 +132,7 @@ struct i2c_adapter *i2c_add_mux_adapter(struct
i2c_adapter *parent,
* nothing if !CONFIG_OF.
*/
if (mux_dev->of_node) {
- struct device_node *child;
+ struct device_node *child = NULL;
u32 reg;
for_each_child_of_node(mux_dev->of_node, child) {
@@ -381,7 +381,7 @@ static int at91_adc_probe_dt(struct at91_adc_state *st,
{
struct iio_dev *idev = iio_priv_to_dev(st);
struct device_node *node = pdev->dev.of_node;
- struct device_node *trig_node;
+ struct device_node *trig_node = NULL;
int i = 0, ret;
u32 prop;
b/drivers/input/keyboard/samsung-keypad.c
@@ -255,7 +255,7 @@ static struct samsung_keypad_platdata
*samsung_keypad_parse_dt(
struct samsung_keypad_platdata *pdata;
struct matrix_keymap_data *keymap_data;
uint32_t *keymap, num_rows = 0, num_cols = 0;
- struct device_node *np = dev->of_node, *key_np;
+ struct device_node *np = dev->of_node, *key_np = NULL;
unsigned int key_count = 0;
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
@@ -168,7 +168,7 @@ static inline int sizeof_gpio_leds_priv(int num_leds)
#ifdef CONFIG_OF_GPIO
static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct
platform_device *pdev)
{
- struct device_node *np = pdev->dev.of_node, *child;
+ struct device_node *np = pdev->dev.of_node, *child = NULL;
struct gpio_leds_priv *priv;
int count = 0, ret;
b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -260,7 +260,7 @@ static int get_ucc_id_for_range(u64 start, u64 end, u32
*ucc_id)
static int fsl_pq_mdio_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
- struct device_node *tbi;
+ struct device_node *tbi = NULL;
struct fsl_pq_mdio_priv *priv;
struct fsl_pq_mdio __iomem *regs = NULL;
void __iomem *map;
@@ -99,7 +99,7 @@ int mdio_mux_init(struct device *dev,
void *data)
{
struct device_node *parent_bus_node;
- struct device_node *child_bus_node;
+ struct device_node *child_bus_node = NULL;
int r, ret_val;
struct mii_bus *parent_bus;
struct mdio_mux_parent_bus *pb;
@@ -21,7 +21,7 @@
void of_i2c_register_devices(struct i2c_adapter *adap)
{
void *result;
- struct device_node *node;
+ struct device_node *node = NULL;
/* Only register child devices if the adapter has a node pointer set
*/
if (!adap->dev.of_node)
@@ -33,7 +33,7 @@ MODULE_LICENSE("GPL");
int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
{
struct phy_device *phy;
- struct device_node *child;
+ struct device_node *child = NULL;
int rc, i;
/* Mask out all PHYs from auto probing. Instead the PHYs listed in
@@ -18,7 +18,7 @@ static inline int __of_pci_pci_compare(struct device_node
*node,
struct device_node *of_pci_find_child_device(struct device_node *parent,
unsigned int devfn)
{
- struct device_node *node, *node2;
+ struct device_node *node = NULL, *node2 = NULL;
for_each_child_of_node(parent, node) {
if (__of_pci_pci_compare(node, devfn))
@@ -344,7 +344,7 @@ static int of_platform_bus_create(struct device_node
*bus,
struct device *parent, bool strict)
{
const struct of_dev_auxdata *auxdata;
- struct device_node *child;
+ struct device_node *child = NULL;
struct platform_device *dev;
const char *bus_id = NULL;
void *platform_data = NULL;
@@ -396,7 +396,7 @@ int of_platform_bus_probe(struct device_node *root,
const struct of_device_id *matches,
struct device *parent)
{
- struct device_node *child;
+ struct device_node *child = NULL;
int rc = 0;
root = root ? of_node_get(root) : of_find_node_by_path("/");
@@ -445,7 +445,7 @@ int of_platform_populate(struct device_node *root,
const struct of_dev_auxdata *lookup,
struct device *parent)
{
- struct device_node *child;
+ struct device_node *child = NULL;
int rc = 0;
root = root ? of_node_get(root) : of_find_node_by_path("/");
@@ -485,7 +485,7 @@ static int __devinit imx_pinctrl_parse_groups(struct
device_node *np,
static int __devinit imx_pinctrl_parse_functions(struct device_node *np,
struct imx_pinctrl_soc_info *info, u32 index)
{
- struct device_node *child;
+ struct device_node *child = NULL;
struct imx_pmx_func *func;
struct imx_pin_group *grp;
int ret;
@@ -521,7 +521,7 @@ static int __devinit imx_pinctrl_probe_dt(struct
platform_device *pdev,
struct imx_pinctrl_soc_info *info)
{
struct device_node *np = pdev->dev.of_node;
- struct device_node *child;
+ struct device_node *child = NULL;
int ret;
u32 nfuncs = 0;
u32 i = 0;
b/drivers/pinctrl/pinctrl-tegra.c
@@ -295,7 +295,7 @@ int tegra_pinctrl_dt_node_to_map(struct pinctrl_dev
*pctldev,
struct pinctrl_map **map, unsigned
*num_maps)
{
unsigned reserved_maps;
- struct device_node *np;
+ struct device_node *np = NULL;
int ret;
reserved_maps = 0;
b/drivers/pinctrl/spear/pinctrl-spear.c
@@ -126,7 +126,7 @@ int spear_pinctrl_dt_node_to_map(struct pinctrl_dev
*pctldev,
struct pinctrl_map **map, unsigned
*num_maps)
{
struct spear_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
- struct device_node *np;
+ struct device_node *np = NULL;
struct property *prop;
const char *function, *group;
int ret, index = 0, count = 0;
b/drivers/regulator/da9052-regulator.c
@@ -396,7 +396,7 @@ static int __devinit da9052_regulator_probe(struct
platform_device *pdev)
} else {
#ifdef CONFIG_OF
struct device_node *nproot = da9052->dev->of_node;
- struct device_node *np;
+ struct device_node *np = NULL;
if (!nproot)
return -ENODEV;
b/drivers/regulator/mc13xxx-regulator-core.c
@@ -173,7 +173,7 @@ EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_ops);
#ifdef CONFIG_OF
int __devinit mc13xxx_get_num_regulators_dt(struct platform_device *pdev)
{
- struct device_node *parent, *child;
+ struct device_node *parent, *child = NULL;
int num = 0;
of_node_get(pdev->dev.parent->of_node);
b/drivers/regulator/of_regulator.c
@@ -113,7 +113,7 @@ int of_regulator_match(struct device *dev, struct
device_node *node,
unsigned int count = 0;
unsigned int i;
const char *regulator_comp;
- struct device_node *child;
+ struct device_node *child = NULL;
if (!dev || !node)
return -EINVAL;
@@ -811,7 +811,7 @@ err_init_queue:
static void of_register_spi_devices(struct spi_master *master)
{
struct spi_device *spi;
- struct device_node *nc;
+ struct device_node *nc = NULL;
const __be32 *prop;
int rc;
int len;
@@ -344,7 +344,7 @@ void __init hvc_opal_init_early(void)
return;
}
} else {
- struct device_node *opal, *np;
+ struct device_node *opal, *np = NULL;
/* Current OPAL takeover doesn't provide the stdout
* path, so we hard wire it