forked from Minki/linux
i2c: move drivers from strlcpy to strscpy
Follow the advice of the below link and prefer 'strscpy'. Conversion is easy because no driver used the return value and has been done with a simple sed invocation. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
parent
663bb7b979
commit
ea1558ce14
@ -447,7 +447,7 @@ static int altr_i2c_probe(struct platform_device *pdev)
|
||||
mutex_unlock(&idev->isr_mutex);
|
||||
|
||||
i2c_set_adapdata(&idev->adapter, idev);
|
||||
strlcpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
|
||||
strscpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
|
||||
idev->adapter.owner = THIS_MODULE;
|
||||
idev->adapter.algo = &altr_i2c_algo;
|
||||
idev->adapter.dev.parent = &pdev->dev;
|
||||
|
@ -1022,7 +1022,7 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
|
||||
bus->adap.algo = &aspeed_i2c_algo;
|
||||
bus->adap.dev.parent = &pdev->dev;
|
||||
bus->adap.dev.of_node = pdev->dev.of_node;
|
||||
strlcpy(bus->adap.name, pdev->name, sizeof(bus->adap.name));
|
||||
strscpy(bus->adap.name, pdev->name, sizeof(bus->adap.name));
|
||||
i2c_set_adapdata(&bus->adap, bus);
|
||||
|
||||
bus->dev = &pdev->dev;
|
||||
|
@ -321,7 +321,7 @@ i2c_au1550_probe(struct platform_device *pdev)
|
||||
priv->adap.algo = &au1550_algo;
|
||||
priv->adap.algo_data = priv;
|
||||
priv->adap.dev.parent = &pdev->dev;
|
||||
strlcpy(priv->adap.name, "Au1xxx PSC I2C", sizeof(priv->adap.name));
|
||||
strscpy(priv->adap.name, "Au1xxx PSC I2C", sizeof(priv->adap.name));
|
||||
|
||||
/* Now, set up the PSC for SMBus PIO mode. */
|
||||
i2c_au1550_setup(priv);
|
||||
|
@ -783,7 +783,7 @@ static int axxia_i2c_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
i2c_set_adapdata(&idev->adapter, idev);
|
||||
strlcpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
|
||||
strscpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
|
||||
idev->adapter.owner = THIS_MODULE;
|
||||
idev->adapter.algo = &axxia_i2c_algo;
|
||||
idev->adapter.bus_recovery_info = &axxia_i2c_recovery_info;
|
||||
|
@ -839,7 +839,7 @@ static int bcm_kona_i2c_probe(struct platform_device *pdev)
|
||||
adap = &dev->adapter;
|
||||
i2c_set_adapdata(adap, dev);
|
||||
adap->owner = THIS_MODULE;
|
||||
strlcpy(adap->name, "Broadcom I2C adapter", sizeof(adap->name));
|
||||
strscpy(adap->name, "Broadcom I2C adapter", sizeof(adap->name));
|
||||
adap->algo = &bcm_algo;
|
||||
adap->dev.parent = &pdev->dev;
|
||||
adap->dev.of_node = pdev->dev.of_node;
|
||||
|
@ -674,7 +674,7 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
|
||||
adap = &dev->adapter;
|
||||
i2c_set_adapdata(adap, dev);
|
||||
adap->owner = THIS_MODULE;
|
||||
strlcpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
|
||||
strscpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
|
||||
adap->algo = &brcmstb_i2c_algo;
|
||||
adap->dev.parent = &pdev->dev;
|
||||
adap->dev.of_node = pdev->dev.of_node;
|
||||
|
@ -245,7 +245,7 @@ static int cbus_i2c_probe(struct platform_device *pdev)
|
||||
adapter->nr = pdev->id;
|
||||
adapter->timeout = HZ;
|
||||
adapter->algo = &cbus_i2c_algo;
|
||||
strlcpy(adapter->name, "CBUS I2C adapter", sizeof(adapter->name));
|
||||
strscpy(adapter->name, "CBUS I2C adapter", sizeof(adapter->name));
|
||||
|
||||
spin_lock_init(&chost->lock);
|
||||
chost->dev = &pdev->dev;
|
||||
|
@ -404,7 +404,7 @@ static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)
|
||||
adap->adapter.class = I2C_CLASS_HWMON;
|
||||
adap->adapter.algo = &cht_wc_i2c_adap_algo;
|
||||
adap->adapter.lock_ops = &cht_wc_i2c_adap_lock_ops;
|
||||
strlcpy(adap->adapter.name, "PMIC I2C Adapter",
|
||||
strscpy(adap->adapter.name, "PMIC I2C Adapter",
|
||||
sizeof(adap->adapter.name));
|
||||
adap->adapter.dev.parent = &pdev->dev;
|
||||
|
||||
|
@ -267,7 +267,7 @@ static int ec_i2c_probe(struct platform_device *pdev)
|
||||
bus->dev = dev;
|
||||
|
||||
bus->adap.owner = THIS_MODULE;
|
||||
strlcpy(bus->adap.name, "cros-ec-i2c-tunnel", sizeof(bus->adap.name));
|
||||
strscpy(bus->adap.name, "cros-ec-i2c-tunnel", sizeof(bus->adap.name));
|
||||
bus->adap.algo = &ec_i2c_algorithm;
|
||||
bus->adap.algo_data = bus;
|
||||
bus->adap.dev.parent = &pdev->dev;
|
||||
|
@ -845,7 +845,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
|
||||
i2c_set_adapdata(adap, dev);
|
||||
adap->owner = THIS_MODULE;
|
||||
adap->class = I2C_CLASS_DEPRECATED;
|
||||
strlcpy(adap->name, "DaVinci I2C adapter", sizeof(adap->name));
|
||||
strscpy(adap->name, "DaVinci I2C adapter", sizeof(adap->name));
|
||||
adap->algo = &i2c_davinci_algo;
|
||||
adap->dev.parent = &pdev->dev;
|
||||
adap->timeout = DAVINCI_I2C_TIMEOUT;
|
||||
|
@ -322,7 +322,7 @@ static int dc_i2c_probe(struct platform_device *pdev)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
strlcpy(i2c->adap.name, "Conexant Digicolor I2C adapter",
|
||||
strscpy(i2c->adap.name, "Conexant Digicolor I2C adapter",
|
||||
sizeof(i2c->adap.name));
|
||||
i2c->adap.owner = THIS_MODULE;
|
||||
i2c->adap.algo = &dc_i2c_algorithm;
|
||||
|
@ -773,7 +773,7 @@ static int pch_i2c_probe(struct pci_dev *pdev,
|
||||
|
||||
pch_adap->owner = THIS_MODULE;
|
||||
pch_adap->class = I2C_CLASS_HWMON;
|
||||
strlcpy(pch_adap->name, KBUILD_MODNAME, sizeof(pch_adap->name));
|
||||
strscpy(pch_adap->name, KBUILD_MODNAME, sizeof(pch_adap->name));
|
||||
pch_adap->algo = &pch_algorithm;
|
||||
pch_adap->algo_data = &adap_info->pch_data[i];
|
||||
|
||||
|
@ -371,7 +371,7 @@ static int em_i2c_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(priv->base))
|
||||
return PTR_ERR(priv->base);
|
||||
|
||||
strlcpy(priv->adap.name, "EMEV2 I2C", sizeof(priv->adap.name));
|
||||
strscpy(priv->adap.name, "EMEV2 I2C", sizeof(priv->adap.name));
|
||||
|
||||
priv->sclk = devm_clk_get(&pdev->dev, "sclk");
|
||||
if (IS_ERR(priv->sclk))
|
||||
|
@ -802,7 +802,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
|
||||
if (of_property_read_u32(np, "clock-frequency", &i2c->op_clock))
|
||||
i2c->op_clock = I2C_MAX_STANDARD_MODE_FREQ;
|
||||
|
||||
strlcpy(i2c->adap.name, "exynos5-i2c", sizeof(i2c->adap.name));
|
||||
strscpy(i2c->adap.name, "exynos5-i2c", sizeof(i2c->adap.name));
|
||||
i2c->adap.owner = THIS_MODULE;
|
||||
i2c->adap.algo = &exynos5_i2c_algorithm;
|
||||
i2c->adap.retries = 3;
|
||||
|
@ -436,7 +436,7 @@ static int i2c_gpio_probe(struct platform_device *pdev)
|
||||
|
||||
adap->owner = THIS_MODULE;
|
||||
if (np)
|
||||
strlcpy(adap->name, dev_name(dev), sizeof(adap->name));
|
||||
strscpy(adap->name, dev_name(dev), sizeof(adap->name));
|
||||
else
|
||||
snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id);
|
||||
|
||||
|
@ -402,7 +402,7 @@ static int highlander_i2c_probe(struct platform_device *pdev)
|
||||
i2c_set_adapdata(adap, dev);
|
||||
adap->owner = THIS_MODULE;
|
||||
adap->class = I2C_CLASS_HWMON;
|
||||
strlcpy(adap->name, "HL FPGA I2C adapter", sizeof(adap->name));
|
||||
strscpy(adap->name, "HL FPGA I2C adapter", sizeof(adap->name));
|
||||
adap->algo = &highlander_i2c_algo;
|
||||
adap->dev.parent = &pdev->dev;
|
||||
adap->nr = pdev->id;
|
||||
|
@ -423,7 +423,7 @@ static int hix5hd2_i2c_probe(struct platform_device *pdev)
|
||||
}
|
||||
clk_prepare_enable(priv->clk);
|
||||
|
||||
strlcpy(priv->adap.name, "hix5hd2-i2c", sizeof(priv->adap.name));
|
||||
strscpy(priv->adap.name, "hix5hd2-i2c", sizeof(priv->adap.name));
|
||||
priv->dev = &pdev->dev;
|
||||
priv->adap.owner = THIS_MODULE;
|
||||
priv->adap.algo = &hix5hd2_i2c_algorithm;
|
||||
|
@ -1116,7 +1116,7 @@ static void dmi_check_onboard_device(u8 type, const char *name,
|
||||
|
||||
memset(&info, 0, sizeof(struct i2c_board_info));
|
||||
info.addr = dmi_devices[i].i2c_addr;
|
||||
strlcpy(info.type, dmi_devices[i].i2c_type, I2C_NAME_SIZE);
|
||||
strscpy(info.type, dmi_devices[i].i2c_type, I2C_NAME_SIZE);
|
||||
i2c_new_client_device(adap, &info);
|
||||
break;
|
||||
}
|
||||
@ -1267,7 +1267,7 @@ static void register_dell_lis3lv02d_i2c_device(struct i801_priv *priv)
|
||||
|
||||
memset(&info, 0, sizeof(struct i2c_board_info));
|
||||
info.addr = dell_lis3lv02d_devices[i].i2c_addr;
|
||||
strlcpy(info.type, "lis3lv02d", I2C_NAME_SIZE);
|
||||
strscpy(info.type, "lis3lv02d", I2C_NAME_SIZE);
|
||||
i2c_new_client_device(&priv->adapter, &info);
|
||||
}
|
||||
|
||||
|
@ -738,7 +738,7 @@ static int iic_probe(struct platform_device *ofdev)
|
||||
adap = &dev->adap;
|
||||
adap->dev.parent = &ofdev->dev;
|
||||
adap->dev.of_node = of_node_get(np);
|
||||
strlcpy(adap->name, "IBM IIC", sizeof(adap->name));
|
||||
strscpy(adap->name, "IBM IIC", sizeof(adap->name));
|
||||
i2c_set_adapdata(adap, dev);
|
||||
adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
|
||||
adap->algo = &iic_algo;
|
||||
|
@ -141,7 +141,7 @@ static int icy_probe(struct zorro_dev *z,
|
||||
i2c->adapter.owner = THIS_MODULE;
|
||||
/* i2c->adapter.algo assigned by i2c_pcf_add_bus() */
|
||||
i2c->adapter.algo_data = algo_data;
|
||||
strlcpy(i2c->adapter.name, "ICY I2C Zorro adapter",
|
||||
strscpy(i2c->adapter.name, "ICY I2C Zorro adapter",
|
||||
sizeof(i2c->adapter.name));
|
||||
|
||||
if (!devm_request_mem_region(&z->dev,
|
||||
|
@ -558,7 +558,7 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
|
||||
lpi2c_imx->adapter.algo = &lpi2c_imx_algo;
|
||||
lpi2c_imx->adapter.dev.parent = &pdev->dev;
|
||||
lpi2c_imx->adapter.dev.of_node = pdev->dev.of_node;
|
||||
strlcpy(lpi2c_imx->adapter.name, pdev->name,
|
||||
strscpy(lpi2c_imx->adapter.name, pdev->name,
|
||||
sizeof(lpi2c_imx->adapter.name));
|
||||
|
||||
lpi2c_imx->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
|
@ -417,7 +417,7 @@ static int i2c_lpc2k_probe(struct platform_device *pdev)
|
||||
|
||||
i2c_set_adapdata(&i2c->adap, i2c);
|
||||
i2c->adap.owner = THIS_MODULE;
|
||||
strlcpy(i2c->adap.name, "LPC2K I2C adapter", sizeof(i2c->adap.name));
|
||||
strscpy(i2c->adap.name, "LPC2K I2C adapter", sizeof(i2c->adap.name));
|
||||
i2c->adap.algo = &i2c_lpc2k_algorithm;
|
||||
i2c->adap.dev.parent = &pdev->dev;
|
||||
i2c->adap.dev.of_node = pdev->dev.of_node;
|
||||
|
@ -502,7 +502,7 @@ static int meson_i2c_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
strlcpy(i2c->adap.name, "Meson I2C adapter",
|
||||
strscpy(i2c->adap.name, "Meson I2C adapter",
|
||||
sizeof(i2c->adap.name));
|
||||
i2c->adap.owner = THIS_MODULE;
|
||||
i2c->adap.algo = &meson_i2c_algorithm;
|
||||
|
@ -1432,7 +1432,7 @@ static int mtk_i2c_probe(struct platform_device *pdev)
|
||||
speed_clk = I2C_MT65XX_CLK_MAIN;
|
||||
}
|
||||
|
||||
strlcpy(i2c->adap.name, I2C_DRV_NAME, sizeof(i2c->adap.name));
|
||||
strscpy(i2c->adap.name, I2C_DRV_NAME, sizeof(i2c->adap.name));
|
||||
|
||||
ret = mtk_i2c_set_speed(i2c, clk_get_rate(i2c->clocks[speed_clk].clk));
|
||||
if (ret) {
|
||||
|
@ -312,7 +312,7 @@ static int mtk_i2c_probe(struct platform_device *pdev)
|
||||
adap->dev.parent = &pdev->dev;
|
||||
i2c_set_adapdata(adap, i2c);
|
||||
adap->dev.of_node = pdev->dev.of_node;
|
||||
strlcpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
|
||||
strscpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
|
||||
|
||||
platform_set_drvdata(pdev, i2c);
|
||||
|
||||
|
@ -989,7 +989,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
|
||||
if (IS_ERR(drv_data->reg_base))
|
||||
return PTR_ERR(drv_data->reg_base);
|
||||
|
||||
strlcpy(drv_data->adapter.name, MV64XXX_I2C_CTLR_NAME " adapter",
|
||||
strscpy(drv_data->adapter.name, MV64XXX_I2C_CTLR_NAME " adapter",
|
||||
sizeof(drv_data->adapter.name));
|
||||
|
||||
init_waitqueue_head(&drv_data->waitq);
|
||||
|
@ -838,7 +838,7 @@ static int mxs_i2c_probe(struct platform_device *pdev)
|
||||
return err;
|
||||
|
||||
adap = &i2c->adapter;
|
||||
strlcpy(adap->name, "MXS I2C adapter", sizeof(adap->name));
|
||||
strscpy(adap->name, "MXS I2C adapter", sizeof(adap->name));
|
||||
adap->owner = THIS_MODULE;
|
||||
adap->algo = &mxs_i2c_algo;
|
||||
adap->quirks = &mxs_i2c_quirks;
|
||||
|
@ -299,7 +299,7 @@ static int gpu_i2c_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
i2c_set_adapdata(&i2cd->adapter, i2cd);
|
||||
i2cd->adapter.owner = THIS_MODULE;
|
||||
strlcpy(i2cd->adapter.name, "NVIDIA GPU I2C adapter",
|
||||
strscpy(i2cd->adapter.name, "NVIDIA GPU I2C adapter",
|
||||
sizeof(i2cd->adapter.name));
|
||||
i2cd->adapter.algo = &gpu_i2c_algorithm;
|
||||
i2cd->adapter.quirks = &gpu_i2c_quirks;
|
||||
|
@ -1488,7 +1488,7 @@ omap_i2c_probe(struct platform_device *pdev)
|
||||
i2c_set_adapdata(adap, omap);
|
||||
adap->owner = THIS_MODULE;
|
||||
adap->class = I2C_CLASS_DEPRECATED;
|
||||
strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
|
||||
strscpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
|
||||
adap->algo = &omap_i2c_algo;
|
||||
adap->quirks = &omap_i2c_quirks;
|
||||
adap->dev.parent = &pdev->dev;
|
||||
|
@ -220,9 +220,9 @@ static int i2c_opal_probe(struct platform_device *pdev)
|
||||
adapter->dev.of_node = of_node_get(pdev->dev.of_node);
|
||||
pname = of_get_property(pdev->dev.of_node, "ibm,port-name", NULL);
|
||||
if (pname)
|
||||
strlcpy(adapter->name, pname, sizeof(adapter->name));
|
||||
strscpy(adapter->name, pname, sizeof(adapter->name));
|
||||
else
|
||||
strlcpy(adapter->name, "opal", sizeof(adapter->name));
|
||||
strscpy(adapter->name, "opal", sizeof(adapter->name));
|
||||
|
||||
platform_set_drvdata(pdev, adapter);
|
||||
rc = i2c_add_adapter(adapter);
|
||||
|
@ -308,7 +308,7 @@ static void i2c_parport_attach(struct parport *port)
|
||||
/* Fill the rest of the structure */
|
||||
adapter->adapter.owner = THIS_MODULE;
|
||||
adapter->adapter.class = I2C_CLASS_HWMON;
|
||||
strlcpy(adapter->adapter.name, "Parallel port adapter",
|
||||
strscpy(adapter->adapter.name, "Parallel port adapter",
|
||||
sizeof(adapter->adapter.name));
|
||||
adapter->algo_data = parport_algo_data;
|
||||
/* Slow down if we can't sense SCL */
|
||||
|
@ -1403,7 +1403,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
|
||||
spin_lock_init(&i2c->lock);
|
||||
init_waitqueue_head(&i2c->wait);
|
||||
|
||||
strlcpy(i2c->adap.name, "pxa_i2c-i2c", sizeof(i2c->adap.name));
|
||||
strscpy(i2c->adap.name, "pxa_i2c-i2c", sizeof(i2c->adap.name));
|
||||
|
||||
i2c->clk = devm_clk_get(&dev->dev, NULL);
|
||||
if (IS_ERR(i2c->clk)) {
|
||||
|
@ -817,7 +817,7 @@ static int geni_i2c_probe(struct platform_device *pdev)
|
||||
i2c_set_adapdata(&gi2c->adap, gi2c);
|
||||
gi2c->adap.dev.parent = dev;
|
||||
gi2c->adap.dev.of_node = dev->of_node;
|
||||
strlcpy(gi2c->adap.name, "Geni-I2C", sizeof(gi2c->adap.name));
|
||||
strscpy(gi2c->adap.name, "Geni-I2C", sizeof(gi2c->adap.name));
|
||||
|
||||
ret = geni_icc_get(&gi2c->se, "qup-memory");
|
||||
if (ret)
|
||||
|
@ -1878,7 +1878,7 @@ nodma:
|
||||
qup->adap.dev.of_node = pdev->dev.of_node;
|
||||
qup->is_last = true;
|
||||
|
||||
strlcpy(qup->adap.name, "QUP I2C adapter", sizeof(qup->adap.name));
|
||||
strscpy(qup->adap.name, "QUP I2C adapter", sizeof(qup->adap.name));
|
||||
|
||||
pm_runtime_set_autosuspend_delay(qup->dev, MSEC_PER_SEC);
|
||||
pm_runtime_use_autosuspend(qup->dev);
|
||||
|
@ -1076,7 +1076,7 @@ static int rcar_i2c_probe(struct platform_device *pdev)
|
||||
adap->bus_recovery_info = &rcar_i2c_bri;
|
||||
adap->quirks = &rcar_i2c_quirks;
|
||||
i2c_set_adapdata(adap, priv);
|
||||
strlcpy(adap->name, pdev->name, sizeof(adap->name));
|
||||
strscpy(adap->name, pdev->name, sizeof(adap->name));
|
||||
|
||||
/* Init DMA */
|
||||
sg_init_table(&priv->sg, 1);
|
||||
|
@ -448,7 +448,7 @@ static int riic_i2c_probe(struct platform_device *pdev)
|
||||
|
||||
adap = &riic->adapter;
|
||||
i2c_set_adapdata(adap, riic);
|
||||
strlcpy(adap->name, "Renesas RIIC adapter", sizeof(adap->name));
|
||||
strscpy(adap->name, "Renesas RIIC adapter", sizeof(adap->name));
|
||||
adap->owner = THIS_MODULE;
|
||||
adap->algo = &riic_algo;
|
||||
adap->dev.parent = &pdev->dev;
|
||||
|
@ -1240,7 +1240,7 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
|
||||
/* use common interface to get I2C timing properties */
|
||||
i2c_parse_fw_timings(&pdev->dev, &i2c->t, true);
|
||||
|
||||
strlcpy(i2c->adap.name, "rk3x-i2c", sizeof(i2c->adap.name));
|
||||
strscpy(i2c->adap.name, "rk3x-i2c", sizeof(i2c->adap.name));
|
||||
i2c->adap.owner = THIS_MODULE;
|
||||
i2c->adap.algo = &rk3x_i2c_algorithm;
|
||||
i2c->adap.retries = 3;
|
||||
|
@ -1076,7 +1076,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
|
||||
else
|
||||
s3c24xx_i2c_parse_dt(pdev->dev.of_node, i2c);
|
||||
|
||||
strlcpy(i2c->adap.name, "s3c2410-i2c", sizeof(i2c->adap.name));
|
||||
strscpy(i2c->adap.name, "s3c2410-i2c", sizeof(i2c->adap.name));
|
||||
i2c->adap.owner = THIS_MODULE;
|
||||
i2c->adap.algo = &s3c24xx_i2c_algorithm;
|
||||
i2c->adap.retries = 2;
|
||||
|
@ -940,7 +940,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
|
||||
adap->nr = dev->id;
|
||||
adap->dev.of_node = dev->dev.of_node;
|
||||
|
||||
strlcpy(adap->name, dev->name, sizeof(adap->name));
|
||||
strscpy(adap->name, dev->name, sizeof(adap->name));
|
||||
|
||||
spin_lock_init(&pd->lock);
|
||||
init_waitqueue_head(&pd->wait);
|
||||
|
@ -99,7 +99,7 @@ static int simtec_i2c_probe(struct platform_device *dev)
|
||||
pd->adap.algo_data = &pd->bit;
|
||||
pd->adap.dev.parent = &dev->dev;
|
||||
|
||||
strlcpy(pd->adap.name, "Simtec I2C", sizeof(pd->adap.name));
|
||||
strscpy(pd->adap.name, "Simtec I2C", sizeof(pd->adap.name));
|
||||
|
||||
pd->bit.data = pd;
|
||||
pd->bit.setsda = simtec_i2c_setsda;
|
||||
|
@ -239,7 +239,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
|
||||
dev_err(&serio->dev, "TAOS EVM identification failed\n");
|
||||
goto exit_close;
|
||||
}
|
||||
strlcpy(adapter->name, name, sizeof(adapter->name));
|
||||
strscpy(adapter->name, name, sizeof(adapter->name));
|
||||
|
||||
/* Turn echo off for better performance */
|
||||
taos->state = TAOS_STATE_EOFF;
|
||||
|
@ -305,7 +305,7 @@ static int tegra_bpmp_i2c_probe(struct platform_device *pdev)
|
||||
|
||||
i2c_set_adapdata(&i2c->adapter, i2c);
|
||||
i2c->adapter.owner = THIS_MODULE;
|
||||
strlcpy(i2c->adapter.name, "Tegra BPMP I2C adapter",
|
||||
strscpy(i2c->adapter.name, "Tegra BPMP I2C adapter",
|
||||
sizeof(i2c->adapter.name));
|
||||
i2c->adapter.algo = &tegra_bpmp_i2c_algo;
|
||||
i2c->adapter.dev.parent = &pdev->dev;
|
||||
|
@ -1825,7 +1825,7 @@ static int tegra_i2c_probe(struct platform_device *pdev)
|
||||
if (i2c_dev->hw->supports_bus_clear)
|
||||
i2c_dev->adapter.bus_recovery_info = &tegra_i2c_recovery_info;
|
||||
|
||||
strlcpy(i2c_dev->adapter.name, dev_name(i2c_dev->dev),
|
||||
strscpy(i2c_dev->adapter.name, dev_name(i2c_dev->dev),
|
||||
sizeof(i2c_dev->adapter.name));
|
||||
|
||||
err = i2c_add_numbered_adapter(&i2c_dev->adapter);
|
||||
|
@ -564,7 +564,7 @@ static int uniphier_fi2c_probe(struct platform_device *pdev)
|
||||
priv->adap.algo = &uniphier_fi2c_algo;
|
||||
priv->adap.dev.parent = dev;
|
||||
priv->adap.dev.of_node = dev->of_node;
|
||||
strlcpy(priv->adap.name, "UniPhier FI2C", sizeof(priv->adap.name));
|
||||
strscpy(priv->adap.name, "UniPhier FI2C", sizeof(priv->adap.name));
|
||||
priv->adap.bus_recovery_info = &uniphier_fi2c_bus_recovery_info;
|
||||
i2c_set_adapdata(&priv->adap, priv);
|
||||
platform_set_drvdata(pdev, priv);
|
||||
|
@ -358,7 +358,7 @@ static int uniphier_i2c_probe(struct platform_device *pdev)
|
||||
priv->adap.algo = &uniphier_i2c_algo;
|
||||
priv->adap.dev.parent = dev;
|
||||
priv->adap.dev.of_node = dev->of_node;
|
||||
strlcpy(priv->adap.name, "UniPhier I2C", sizeof(priv->adap.name));
|
||||
strscpy(priv->adap.name, "UniPhier I2C", sizeof(priv->adap.name));
|
||||
priv->adap.bus_recovery_info = &uniphier_i2c_bus_recovery_info;
|
||||
i2c_set_adapdata(&priv->adap, priv);
|
||||
platform_set_drvdata(pdev, priv);
|
||||
|
@ -79,7 +79,7 @@ static int i2c_versatile_probe(struct platform_device *dev)
|
||||
writel(SCL | SDA, i2c->base + I2C_CONTROLS);
|
||||
|
||||
i2c->adap.owner = THIS_MODULE;
|
||||
strlcpy(i2c->adap.name, "Versatile I2C adapter", sizeof(i2c->adap.name));
|
||||
strscpy(i2c->adap.name, "Versatile I2C adapter", sizeof(i2c->adap.name));
|
||||
i2c->adap.algo_data = &i2c->algo;
|
||||
i2c->adap.dev.parent = &dev->dev;
|
||||
i2c->adap.dev.of_node = dev->dev.of_node;
|
||||
|
@ -413,7 +413,7 @@ static int wmt_i2c_probe(struct platform_device *pdev)
|
||||
|
||||
adap = &i2c_dev->adapter;
|
||||
i2c_set_adapdata(adap, i2c_dev);
|
||||
strlcpy(adap->name, "WMT I2C adapter", sizeof(adap->name));
|
||||
strscpy(adap->name, "WMT I2C adapter", sizeof(adap->name));
|
||||
adap->owner = THIS_MODULE;
|
||||
adap->algo = &wmt_i2c_algo;
|
||||
adap->dev.parent = &pdev->dev;
|
||||
|
Loading…
Reference in New Issue
Block a user