aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/flash
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-04-13 23:08:22 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-13 23:08:22 +0000
commitead64e84544012f569ad5b28f36915dba26d6fa7 (patch)
tree1364297005465d9c7aa97cece96efd12874ab96f /sys/dev/flash
parente19883539ab886097f170622395b18c0193f5faa (diff)
Diffstat (limited to 'sys/dev/flash')
-rw-r--r--sys/dev/flash/cqspi.c10
-rw-r--r--sys/dev/flash/n25q.c4
2 files changed, 4 insertions, 10 deletions
diff --git a/sys/dev/flash/cqspi.c b/sys/dev/flash/cqspi.c
index 54752792798d..b1b1f4cbc7ad 100644
--- a/sys/dev/flash/cqspi.c
+++ b/sys/dev/flash/cqspi.c
@@ -336,10 +336,9 @@ static int
cqspi_wait_ready(struct cqspi_softc *sc)
{
uint8_t data;
- int ret;
do {
- ret = cqspi_cmd_read(sc, CMD_READ_STATUS, &data, 1);
+ cqspi_cmd_read(sc, CMD_READ_STATUS, &data, 1);
} while (data & STATUS_WIP);
return (0);
@@ -392,17 +391,16 @@ static int
cqspi_erase(device_t dev, device_t child, off_t offset)
{
struct cqspi_softc *sc;
- int ret;
sc = device_get_softc(dev);
cqspi_wait_idle(sc);
cqspi_wait_ready(sc);
- ret = cqspi_cmd_write(sc, CMD_WRITE_ENABLE, 0, 0);
+ cqspi_cmd_write(sc, CMD_WRITE_ENABLE, 0, 0);
cqspi_wait_idle(sc);
cqspi_wait_ready(sc);
- ret = cqspi_cmd_write_addr(sc, CMD_QUAD_SECTOR_ERASE, offset, 4);
+ cqspi_cmd_write_addr(sc, CMD_QUAD_SECTOR_ERASE, offset, 4);
cqspi_wait_idle(sc);
@@ -422,7 +420,7 @@ cqspi_write(device_t dev, device_t child, struct bio *bp,
sc = device_get_softc(dev);
cqspi_wait_ready(sc);
- reg = cqspi_cmd_write(sc, CMD_WRITE_ENABLE, 0, 0);
+ cqspi_cmd_write(sc, CMD_WRITE_ENABLE, 0, 0);
cqspi_wait_idle(sc);
cqspi_wait_ready(sc);
diff --git a/sys/dev/flash/n25q.c b/sys/dev/flash/n25q.c
index cf7bfeef1ee1..b64d3fa57474 100644
--- a/sys/dev/flash/n25q.c
+++ b/sys/dev/flash/n25q.c
@@ -189,12 +189,10 @@ n25q_get_device_ident(struct n25q_softc *sc)
static int
n25q_write(device_t dev, struct bio *bp, off_t offset, caddr_t data, off_t count)
{
- struct n25q_softc *sc;
device_t pdev;
int err;
pdev = device_get_parent(dev);
- sc = device_get_softc(dev);
dprintf("%s: offset 0x%llx count %lld bytes\n", __func__, offset, count);
@@ -239,12 +237,10 @@ n25q_read(device_t dev, struct bio *bp, off_t offset, caddr_t data, off_t count)
static int
n25q_set_4b_mode(device_t dev, uint8_t command)
{
- struct n25q_softc *sc;
device_t pdev;
int err;
pdev = device_get_parent(dev);
- sc = device_get_softc(dev);
err = QSPI_WRITE_REG(pdev, dev, command, 0, 0);