[U-Boot] [PATCH 1/3] fs: Makefile: Add fs.c under SPL as well as it is needed for fs_loader

Add fs.c under SPL as well as it is needed for fs_loader
Signed-off-by: Keerthy j-keerthy@ti.com --- fs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/Makefile b/fs/Makefile index bad0c2c..b4ca1b3 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -8,7 +8,6 @@ ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/ obj-$(CONFIG_SPL_EXT_SUPPORT) += ext4/ else -obj-y += fs.o
obj-$(CONFIG_FS_BTRFS) += btrfs/ obj-$(CONFIG_FS_CBFS) += cbfs/ @@ -22,4 +21,5 @@ obj-$(CONFIG_CMD_UBIFS) += ubifs/ obj-$(CONFIG_YAFFS2) += yaffs2/ obj-$(CONFIG_CMD_ZFS) += zfs/ endif +obj-y += fs.o obj-y += fs_internal.o

Instead of two staged ofnode_to_offset followed by device_get_global_by_of_offset approach, direcly use the device_get_global_by_ofnode to fetch the device.
Signed-off-by: Keerthy j-keerthy@ti.com --- drivers/misc/fs_loader.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c index b7bb96a..5afc941 100644 --- a/drivers/misc/fs_loader.c +++ b/drivers/misc/fs_loader.c @@ -55,11 +55,9 @@ static int select_fs_dev(struct device_platdata *plat)
node = ofnode_get_by_phandle(plat->phandlepart.phandle);
- int of_offset = ofnode_to_offset(node); - struct udevice *dev;
- ret = device_get_global_by_of_offset(of_offset, &dev); + ret = device_get_global_by_ofnode(node, &dev); if (!ret) { struct blk_desc *desc = blk_get_by_device(dev); if (desc) { @@ -190,6 +188,7 @@ static int fw_get_filesystem_firmware(struct device_platdata *plat,
ret = fs_read(fw_priv->name, (ulong)map_to_sysmem(firmware->data), fw_priv->offset, firmware->size, &actread); + if (ret) { debug("Error: %d Failed to read %s from flash %lld != %d.\n", ret, fw_priv->name, actread, firmware->size);

On 4 November 2018 at 23:04, Keerthy j-keerthy@ti.com wrote:
Instead of two staged ofnode_to_offset followed by device_get_global_by_of_offset approach, direcly use the device_get_global_by_ofnode to fetch the device.
Signed-off-by: Keerthy j-keerthy@ti.com
drivers/misc/fs_loader.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
with change below
diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c index b7bb96a..5afc941 100644 --- a/drivers/misc/fs_loader.c +++ b/drivers/misc/fs_loader.c @@ -55,11 +55,9 @@ static int select_fs_dev(struct device_platdata *plat)
node = ofnode_get_by_phandle(plat->phandlepart.phandle);
int of_offset = ofnode_to_offset(node);
struct udevice *dev;
ret = device_get_global_by_of_offset(of_offset, &dev);
ret = device_get_global_by_ofnode(node, &dev); if (!ret) { struct blk_desc *desc = blk_get_by_device(dev); if (desc) {
@@ -190,6 +188,7 @@ static int fw_get_filesystem_firmware(struct device_platdata *plat,
ret = fs_read(fw_priv->name, (ulong)map_to_sysmem(firmware->data), fw_priv->offset, firmware->size, &actread);
Please drop this blank line.
if (ret) { debug("Error: %d Failed to read %s from flash %lld != %d.\n", ret, fw_priv->name, actread, firmware->size);
-- 1.9.1

On Mon, Nov 05, 2018 at 11:34:53AM +0530, Keerthy wrote:
Instead of two staged ofnode_to_offset followed by device_get_global_by_of_offset approach, direcly use the device_get_global_by_ofnode to fetch the device.
Signed-off-by: Keerthy j-keerthy@ti.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

Fix compiler warning
drivers/misc/fs_loader.c:193:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
Signed-off-by: Keerthy j-keerthy@ti.com --- drivers/misc/fs_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c index 5afc941..baa5f83 100644 --- a/drivers/misc/fs_loader.c +++ b/drivers/misc/fs_loader.c @@ -190,7 +190,7 @@ static int fw_get_filesystem_firmware(struct device_platdata *plat, fw_priv->offset, firmware->size, &actread);
if (ret) { - debug("Error: %d Failed to read %s from flash %lld != %d.\n", + debug("Error: %d Failed to read %s from flash %lld != %zu.\n", ret, fw_priv->name, actread, firmware->size); } else { ret = actread;

On 4 November 2018 at 23:04, Keerthy j-keerthy@ti.com wrote:
Fix compiler warning
drivers/misc/fs_loader.c:193:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
Signed-off-by: Keerthy j-keerthy@ti.com
drivers/misc/fs_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Mon, Nov 05, 2018 at 11:34:54AM +0530, Keerthy wrote:
Fix compiler warning
drivers/misc/fs_loader.c:193:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
Signed-off-by: Keerthy j-keerthy@ti.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!

On 4 November 2018 at 23:04, Keerthy j-keerthy@ti.com wrote:
Add fs.c under SPL as well as it is needed for fs_loader
Signed-off-by: Keerthy j-keerthy@ti.com
fs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Mon, Nov 05, 2018 at 11:34:52AM +0530, Keerthy wrote:
Add fs.c under SPL as well as it is needed for fs_loader
Signed-off-by: Keerthy j-keerthy@ti.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!
participants (3)
-
Keerthy
-
Simon Glass
-
Tom Rini