Skip to contentSkip to conversation

fs: Makefile: Add fs.c under SPL as well as it is needed for fs_loader

PATCH New Keerthy 3 participants 9 messages Nov 5, 2018 – Nov 17, 2018

Subsystems (2)
lore
Share & tools
lore

Keerthy

author
#0 lore raw

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

---
 fs/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/Makefile +1 -1
index bad0c2c..b4ca1b3 100644
@@ -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
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 2/3 misc: fs_loader: Use device_get_global_by_ofnode to get to node

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.

---
 drivers/misc/fs_loader.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/misc/fs_loader.c +2 -3
index b7bb96a..5afc941 100644
@@ -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);
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 misc: fs_loader: Use device_get_global_by_ofnode to get to node

Quoted 8 lines · Keerthy

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.

---
 drivers/misc/fs_loader.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

with change below

Quoted 19 lines
drivers/misc/fs_loader.c +1 -3
index b7bb96a..5afc941 100644
@@ -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) {

drivers/misc/fs_loader.c static int fw_get_filesystem_firmware(struct device_platdata *plat, · line 191

Quoted 4 lines
drivers/misc/fs_loader.c +1 -0
@@ -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.

Quoted 6 lines
drivers/misc/fs_loader.c +0 -1
        if (ret) {
                debug("Error: %d Failed to read %s from flash %lld != %d.\n",
                      ret, fw_priv->name, actread, firmware->size);
--

1.9.1

#3 lore raw

PATCH 2/3 misc: fs_loader: Use device_get_global_by_ofnode to get to node

In reply to Keerthy
Quoted 6 lines · Keerthy

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181117/36ef1fac/attachment.sig>
author
#4 lore raw

PATCH 3/3 misc: fs_loader: Fix compiler warning

In reply to Keerthy

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=]

---
 drivers/misc/fs_loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/fs_loader.c +1 -1
index 5afc941..baa5f83 100644
@@ -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;
Signature · 1 line
1.9.1
#5 lore raw

PATCH 3/3 misc: fs_loader: Fix compiler warning

Quoted 10 lines · Keerthy

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=]

---
 drivers/misc/fs_loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#6 lore raw

PATCH 3/3 misc: fs_loader: Fix compiler warning

In reply to Keerthy
Quoted 8 lines · Keerthy

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=]

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181117/874d4c02/attachment.sig>
#8 lore raw

PATCH 1/3 fs: Makefile: Add fs.c under SPL as well as it is needed for fs_loader

In reply to Keerthy
Quoted 4 lines · Keerthy

Add fs.c under SPL as well as it is needed for fs_loader

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181117/8178b378/attachment.sig>