summaryrefslogtreecommitdiff
path: root/drivers/w1/masters
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-08-06 11:08:37 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-08-06 11:08:37 +0200
commitd72adfacc399e76bb85ff69c8d47efb818adefc5 (patch)
tree694188f1d4dfc0546e2af9c55984da9c46e9b64d /drivers/w1/masters
parent5924b749b3970f83870491880ba2342983551f3c (diff)
parent4d3721b204f961e905714954ff95633337b768e3 (diff)
downloadlinux-next-d72adfacc399e76bb85ff69c8d47efb818adefc5.tar.gz
linux-next-d72adfacc399e76bb85ff69c8d47efb818adefc5.zip
Merge tag 'w1-drv-7.3' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1 into char-misc-next
Krzysztof writes: 1-Wire bus drivers for v7.3 1. Improve (fix) ds2482 driver module autoloading, when probing from Devicetree. 2. Convert HDQ One Wire devicetree bindings to DT schema format. 3. Fixes for handling incorrect data from potentially malicious hardware, looking theoretical issues but still worth to fix. Affected drivers: w1 core code, ds28e17 and ds2482. * tag 'w1-drv-7.3' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1: w1: ds2482: Fix signedness bug in ds2482_w1_triplet() w1: validate slave string length before checking separator w1: ds28e17: reject an oversize length on an I2C block read dt-bindings: w1: Convert HDQ One Wire to DT schema w1: ds2482: add OF device match table
Diffstat (limited to 'drivers/w1/masters')
-rw-r--r--drivers/w1/masters/ds2482.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index 0069e6f854d7..cbd11bc61274 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -310,6 +310,10 @@ static u8 ds2482_w1_triplet(void *data, u8 dbit)
mutex_unlock(&pdev->access_lock);
+ /* On bus error, decode to 3 (no device responded) to abort the search */
+ if (status < 0)
+ status = 3 << 5;
+
/* Decode the status */
return (status >> 5);
}
@@ -545,9 +549,17 @@ static const struct i2c_device_id ds2482_id[] = {
};
MODULE_DEVICE_TABLE(i2c, ds2482_id);
+static const struct of_device_id ds2482_of_match[] = {
+ { .compatible = "maxim,ds2482", },
+ { .compatible = "maxim,ds2484", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ds2482_of_match);
+
static struct i2c_driver ds2482_driver = {
.driver = {
.name = "ds2482",
+ .of_match_table = ds2482_of_match,
},
.probe = ds2482_probe,
.remove = ds2482_remove,