mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-11 17:10:13 +00:00
1-Wire bus drivers for v6.19
Just a bunch of cleanups for few 1-Wire drivers: use sysfs_emit() in sysfs show, avoid strcpy() and strcat(), and drop unneeded pm_runtime_mark_last_busy() because core runtime PM handles it. -----BEGIN PGP SIGNATURE----- iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmka/d4QHGtyemtAa2Vy bmVsLm9yZwAKCRDBN2bmhouD14SYD/0Z2pZUZoCWKIDkf4nSEcX62SshgBFN988k 1MIoQGyjFIswnO9b73nF5S+IOxcotIshkQllrZJhKXLGXmtO1oPRDqZq4phs40FM rpwDiBf2z/0u9NRlKT8D5uPNQk3yYYvP8+5Y3DFvAoUcva7gfbrzupcdfTQhL1gQ iEcSbxQFdoj3NyMpRIuE0t1wQ5D5bR0i+7IPnO4i3ylXAUsrDogdv6b3AV4vmkO/ sHn4jlahU27VdTPXYTQUW9a2ylSar+BKbISb7CvZEaCZmfup9pY8mDMwZAGEhxSu bdXTQ5kKfCFnUCA012MybBTBu8enk7qiHo9SdUOZVqE5PAh/HjHXi5lppCQZ5/el WISSBl3//U4Lpme5ave3mVFDpOUuJADni5Jzpp2YBW8bqNST589qVwt4H24D+thv ChrsJXLpuC3WawOy73WVvnXADnwgsBkFJzNs13TOnTG51MN7yP0rFW4tv5xHNAfD Rrji6rWt9JLofxE78C+Nmfi2YKQvyuk5uhKrqkcBL+okc5Qlhk3nL50rXVdGuTvN sjRYq7oU5a+gQoEucFD3JDdRCN/S/gpvLDsZdcH5okFUragJeXU7O8e6Jdou2eP/ QSf3GNDrJ8+FHvczKySAfaKKQTpHpsDMRe3y+bu5cy7ZQLpexrtXOtDv3S0zpjZK A9VX5augAg== =nP4E -----END PGP SIGNATURE----- Merge tag 'w1-drv-6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1 into char-misc-next Krzysztof writes: 1-Wire bus drivers for v6.19 Just a bunch of cleanups for few 1-Wire drivers: use sysfs_emit() in sysfs show, avoid strcpy() and strcat(), and drop unneeded pm_runtime_mark_last_busy() because core runtime PM handles it. * tag 'w1-drv-6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1: w1: omap-hdq: Remove redundant pm_runtime_mark_last_busy() calls w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave w1: use sysfs_emit() in sysfs show() callbacks
This commit is contained in:
commit
623db9a1dd
@ -445,7 +445,6 @@ static u8 omap_w1_triplet(void *_hdq, u8 bdir)
|
||||
out:
|
||||
mutex_unlock(&hdq_data->hdq_mutex);
|
||||
rtn:
|
||||
pm_runtime_mark_last_busy(hdq_data->dev);
|
||||
pm_runtime_put_autosuspend(hdq_data->dev);
|
||||
|
||||
return ret;
|
||||
@ -466,7 +465,6 @@ static u8 omap_w1_reset_bus(void *_hdq)
|
||||
|
||||
omap_hdq_break(hdq_data);
|
||||
|
||||
pm_runtime_mark_last_busy(hdq_data->dev);
|
||||
pm_runtime_put_autosuspend(hdq_data->dev);
|
||||
|
||||
return 0;
|
||||
@ -490,7 +488,6 @@ static u8 omap_w1_read_byte(void *_hdq)
|
||||
if (ret)
|
||||
val = -1;
|
||||
|
||||
pm_runtime_mark_last_busy(hdq_data->dev);
|
||||
pm_runtime_put_autosuspend(hdq_data->dev);
|
||||
|
||||
return val;
|
||||
@ -525,7 +522,6 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
|
||||
}
|
||||
|
||||
out_err:
|
||||
pm_runtime_mark_last_busy(hdq_data->dev);
|
||||
pm_runtime_put_autosuspend(hdq_data->dev);
|
||||
}
|
||||
|
||||
@ -625,7 +621,6 @@ static int omap_hdq_probe(struct platform_device *pdev)
|
||||
|
||||
omap_hdq_break(hdq_data);
|
||||
|
||||
pm_runtime_mark_last_busy(&pdev->dev);
|
||||
pm_runtime_put_autosuspend(&pdev->dev);
|
||||
|
||||
omap_w1_master.data = hdq_data;
|
||||
|
||||
@ -719,8 +719,8 @@ static int w1_f19_add_slave(struct w1_slave *sl)
|
||||
data->adapter.owner = THIS_MODULE;
|
||||
data->adapter.algo = &w1_f19_i2c_algorithm;
|
||||
data->adapter.algo_data = sl;
|
||||
strcpy(data->adapter.name, "w1-");
|
||||
strcat(data->adapter.name, sl->name);
|
||||
scnprintf(data->adapter.name, sizeof(data->adapter.name), "w1-%s",
|
||||
sl->name);
|
||||
data->adapter.dev.parent = &sl->dev;
|
||||
data->adapter.quirks = &w1_f19_i2c_adapter_quirks;
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ static ssize_t name_show(struct device *dev, struct device_attribute *attr, char
|
||||
{
|
||||
struct w1_slave *sl = dev_to_w1_slave(dev);
|
||||
|
||||
return sprintf(buf, "%s\n", sl->name);
|
||||
return sysfs_emit(buf, "%s\n", sl->name);
|
||||
}
|
||||
static DEVICE_ATTR_RO(name);
|
||||
|
||||
@ -207,7 +207,7 @@ static ssize_t w1_master_attribute_show_name(struct device *dev, struct device_a
|
||||
ssize_t count;
|
||||
|
||||
mutex_lock(&md->mutex);
|
||||
count = sprintf(buf, "%s\n", md->name);
|
||||
count = sysfs_emit(buf, "%s\n", md->name);
|
||||
mutex_unlock(&md->mutex);
|
||||
|
||||
return count;
|
||||
@ -243,7 +243,7 @@ static ssize_t w1_master_attribute_show_search(struct device *dev,
|
||||
ssize_t count;
|
||||
|
||||
mutex_lock(&md->mutex);
|
||||
count = sprintf(buf, "%d\n", md->search_count);
|
||||
count = sysfs_emit(buf, "%d\n", md->search_count);
|
||||
mutex_unlock(&md->mutex);
|
||||
|
||||
return count;
|
||||
@ -276,7 +276,7 @@ static ssize_t w1_master_attribute_show_pullup(struct device *dev,
|
||||
ssize_t count;
|
||||
|
||||
mutex_lock(&md->mutex);
|
||||
count = sprintf(buf, "%d\n", md->enable_pullup);
|
||||
count = sysfs_emit(buf, "%d\n", md->enable_pullup);
|
||||
mutex_unlock(&md->mutex);
|
||||
|
||||
return count;
|
||||
@ -288,20 +288,20 @@ static ssize_t w1_master_attribute_show_pointer(struct device *dev, struct devic
|
||||
ssize_t count;
|
||||
|
||||
mutex_lock(&md->mutex);
|
||||
count = sprintf(buf, "0x%p\n", md->bus_master);
|
||||
count = sysfs_emit(buf, "0x%p\n", md->bus_master);
|
||||
mutex_unlock(&md->mutex);
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t w1_master_attribute_show_timeout(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return sprintf(buf, "%d\n", w1_timeout);
|
||||
return sysfs_emit(buf, "%d\n", w1_timeout);
|
||||
}
|
||||
|
||||
static ssize_t w1_master_attribute_show_timeout_us(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return sprintf(buf, "%d\n", w1_timeout_us);
|
||||
return sysfs_emit(buf, "%d\n", w1_timeout_us);
|
||||
}
|
||||
|
||||
static ssize_t w1_master_attribute_store_max_slave_count(struct device *dev,
|
||||
@ -328,7 +328,7 @@ static ssize_t w1_master_attribute_show_max_slave_count(struct device *dev, stru
|
||||
ssize_t count;
|
||||
|
||||
mutex_lock(&md->mutex);
|
||||
count = sprintf(buf, "%d\n", md->max_slave_count);
|
||||
count = sysfs_emit(buf, "%d\n", md->max_slave_count);
|
||||
mutex_unlock(&md->mutex);
|
||||
return count;
|
||||
}
|
||||
@ -339,7 +339,7 @@ static ssize_t w1_master_attribute_show_attempts(struct device *dev, struct devi
|
||||
ssize_t count;
|
||||
|
||||
mutex_lock(&md->mutex);
|
||||
count = sprintf(buf, "%lu\n", md->attempts);
|
||||
count = sysfs_emit(buf, "%lu\n", md->attempts);
|
||||
mutex_unlock(&md->mutex);
|
||||
return count;
|
||||
}
|
||||
@ -350,7 +350,7 @@ static ssize_t w1_master_attribute_show_slave_count(struct device *dev, struct d
|
||||
ssize_t count;
|
||||
|
||||
mutex_lock(&md->mutex);
|
||||
count = sprintf(buf, "%d\n", md->slave_count);
|
||||
count = sysfs_emit(buf, "%d\n", md->slave_count);
|
||||
mutex_unlock(&md->mutex);
|
||||
return count;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user