Skip to content

Commit

Permalink
watchdog: ziirave_wdt: Drop ziirave_firm_write_block_data()
Browse files Browse the repository at this point in the history
There's only one user of ziirave_firm_write_block_data(), so we may as
well inline it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Rick Ramstetter <rick@anteaterllc.com>
Cc: linux-watchdog@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20190812200906.31344-22-andrew.smirnov@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
  • Loading branch information
Andrey Smirnov authored and Wim Van Sebroeck committed Sep 17, 2019
1 parent fa0d2f4 commit 08c913f
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions drivers/watchdog/ziirave_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,26 +197,6 @@ static int ziirave_firm_set_read_addr(struct watchdog_device *wdd, u32 addr)
sizeof(address), address);
}

static int ziirave_firm_write_block_data(struct watchdog_device *wdd,
u8 command, u8 length, const u8 *data,
bool wait_for_ack)
{
struct i2c_client *client = to_i2c_client(wdd->parent);
int ret;

ret = i2c_smbus_write_block_data(client, command, length, data);
if (ret) {
dev_err(&client->dev,
"Failed to send command 0x%02x: %d\n", command, ret);
return ret;
}

if (wait_for_ack)
ret = ziirave_firm_read_ack(wdd);

return ret;
}

static bool ziirave_firm_addr_readonly(u32 addr)
{
return addr < ZIIRAVE_FIRM_FLASH_MEMORY_START ||
Expand Down Expand Up @@ -273,8 +253,15 @@ static int __ziirave_firm_write_pkt(struct watchdog_device *wdd,
checksum += packet[i];
packet[ZIIRAVE_FIRM_PKT_TOTAL_SIZE - 1] = checksum;

ret = ziirave_firm_write_block_data(wdd, ZIIRAVE_CMD_DOWNLOAD_PACKET,
sizeof(packet), packet, true);
ret = i2c_smbus_write_block_data(client, ZIIRAVE_CMD_DOWNLOAD_PACKET,
sizeof(packet), packet);
if (ret) {
dev_err(&client->dev,
"Failed to send DOWNLOAD_PACKET: %d\n", ret);
return ret;
}

ret = ziirave_firm_read_ack(wdd);
if (ret)
dev_err(&client->dev,
"Failed to write firmware packet at address 0x%04x: %d\n",
Expand Down

0 comments on commit 08c913f

Please sign in to comment.