diff options
author | Oleksij Rempel <o.rempel@pengutronix.de> | 2022-03-28 14:09:56 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-04-01 15:03:33 +0200 |
commit | 8d4698e793d823590f050b36b26f67f73d5f9e85 (patch) | |
tree | 4e30de251d091962b0b54260d1649bdd098c0d95 /arch/arm | |
parent | 324f419585c3fa42eaee0dd297181b6b8694a6fc (diff) | |
download | barebox-8d4698e793d823590f050b36b26f67f73d5f9e85.tar.gz barebox-8d4698e793d823590f050b36b26f67f73d5f9e85.tar.xz |
ARM: boards: protonic-imx6: fix file system access warning
We should not access a file system from the poller. So, do it from the
worker. This patch will fix warning on FS access for Protonic board
code.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.barebox.org/20220328120956.2402132-1-o.rempel@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/boards/protonic-imx6/board.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/arch/arm/boards/protonic-imx6/board.c b/arch/arm/boards/protonic-imx6/board.c index 1a5c1a7bbd..52cf39917a 100644 --- a/arch/arm/boards/protonic-imx6/board.c +++ b/arch/arm/boards/protonic-imx6/board.c @@ -21,6 +21,7 @@ #include <sys/stat.h> #include <unistd.h> #include <usb/usb.h> +#include <work.h> #define GPIO_HW_REV_ID {\ {IMX_GPIO_NR(2, 8), GPIOF_DIR_IN | GPIOF_ACTIVE_LOW, "rev_id0"}, \ @@ -85,9 +86,10 @@ struct prt_imx6_priv { unsigned int hw_id; unsigned int hw_rev; const char *name; - struct poller_async poller; unsigned int usb_delay; unsigned int no_usb_check; + struct work_queue wq; + struct work_struct work; }; struct prti6q_rfid_contents { @@ -290,9 +292,9 @@ exit_usb_mount: #define OTG_PORTSC1 (MX6_OTG_BASE_ADDR+0x184) -static void prt_imx6_check_usb_boot(void *data) +static void prt_imx6_check_usb_boot_do_work(struct work_struct *w) { - struct prt_imx6_priv *priv = data; + struct prt_imx6_priv *priv = container_of(w, struct prt_imx6_priv, work); struct device_d *dev = priv->dev; char *second_word, *bootsrc, *usbdisk; char buf[sizeof("vicut1q recovery")] = {}; @@ -462,7 +464,6 @@ exit_bbu: static int prt_imx6_devices_init(void) { struct prt_imx6_priv *priv = prt_priv; - int ret; if (!priv) return 0; @@ -477,14 +478,12 @@ static int prt_imx6_devices_init(void) prt_imx6_env_init(priv); if (!priv->no_usb_check) { - ret = poller_async_register(&priv->poller, "usb-boot"); - if (ret) { - dev_err(priv->dev, "can't setup poller\n"); - return ret; - } + priv->wq.fn = prt_imx6_check_usb_boot_do_work; + + wq_register(&priv->wq); - poller_call_async(&priv->poller, priv->usb_delay * SECOND, - &prt_imx6_check_usb_boot, priv); + wq_queue_delayed_work(&priv->wq, &priv->work, + priv->usb_delay * SECOND); } return 0; |