]> git.sur5r.net Git - u-boot/commit
disk: make get_partition_info() always available to disk.c
authorStephen Warren <swarren@nvidia.com>
Fri, 21 Sep 2012 12:46:54 +0000 (12:46 +0000)
committerTom Rini <trini@ti.com>
Tue, 25 Sep 2012 21:43:19 +0000 (14:43 -0700)
commit2f5016462710050ce6c052bbc87cba115f53a51f
tree519187030115374b2393aaedf8fcb60b629f7e70
parentcce5d210e68cab42944be74b8fe0c071b57f6949
disk: make get_partition_info() always available to disk.c

Now that get_device_and_partition() always calls get_partition_info()
when disk.c is compiled, we must always compile the function, rather
than ifdef it away.

The implementation must be conditional based on CONFIG_CMD_* etc., since
that's what e.g. part_dos.c uses to ifdef out get_partition_info_dos();
CONFIG_DOS_PARTITION can be enabled even without those commands being
enabled.

Technically, this change is required before Rob's "disk/part: introduce
get_device_and_partition" patch. However, at least when the compiler
optimizer is turned on, it isn't required before then in practice,
since get_device_and_partition() calls get_dev(), which is stubbed out
in disk.c under exactly the same conditions that get_partition_info()
is not compiled, and hence the compiler never generates code for the
call to the missing function. However, in my later patch "disk:
get_device_and_partition() "auto" partition and cleanup", the optimizer
doesn't succeed at this, and may attempt to reference the undefined
function.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
disk/part.c