Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227713
b: refs/heads/master
c: 45efe84
h: refs/heads/master
i:
  227711: 589d8b2
v: v3
  • Loading branch information
Wolfram Sang authored and Grant Likely committed Dec 24, 2010
1 parent 96ef8f2 commit 7306191
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ed030d728f3bd03b6e869357da02725afda19a7
refs/heads/master: 45efe847971e6274a04eea75a0745d8015b54d37
10 changes: 10 additions & 0 deletions trunk/drivers/misc/eeprom/at24.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,11 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
if (!is_power_of_2(chip.byte_len))
dev_warn(&client->dev,
"byte_len looks suspicious (no power of 2)!\n");
if (!chip.page_size) {
dev_err(&client->dev, "page_size must not be 0!\n");
err = -EINVAL;
goto err_out;
}
if (!is_power_of_2(chip.page_size))
dev_warn(&client->dev,
"page_size looks suspicious (no power of 2)!\n");
Expand Down Expand Up @@ -681,6 +686,11 @@ static struct i2c_driver at24_driver = {

static int __init at24_init(void)
{
if (!io_limit) {
pr_err("at24: io_limit must not be 0!\n");
return -EINVAL;
}

io_limit = rounddown_pow_of_two(io_limit);
return i2c_add_driver(&at24_driver);
}
Expand Down

0 comments on commit 7306191

Please sign in to comment.