Re: [RFC PATCH 3/5] firmware_loader: Split fw_sysfs support from fallback

From: Tom Rix
Date: Sun Feb 06 2022 - 10:43:37 EST



On 2/3/22 1:30 PM, Russ Weight wrote:
In preparation for sharing the "loading" and "data" sysfs nodes with the
new firmware upload support, split out sysfs functionality from fallback.c
and fallback.h into fw_sysfs.c and fw_sysfs.h. This includes the firmware
class driver code that is associated with the sysfs files and the
fw_fallback_config support for the timeout sysfs node.

CONFIG_FW_LOADER_SYSFS is created and is selected by
CONFIG_FW_LOADER_USER_HELPER in order to include fw_sysfs.o in
firmware_class-objs.

This is mostly just a code reorganization. There are a few symbols that
change in scope, and these can be identified by looking at the header
file changes. A few white-space warnings from checkpatch are also
addressed in this patch.

Signed-off-by: Russ Weight <russell.h.weight@xxxxxxxxx>

Consider how bisectable and reviewable this patch is.

I think this patch should be first since reorganizing should not depend on anything new.

Other users of fallback will want to know if this change is going to break them, so the reorganization should be as mechanical as possible to make the review as easy as possible and easy to revert if something goes wrong.  Ex/ the whitespace changes made as a separate patch to the old file, not embedded in the new file.  The new Kconfig added later if needed.

Also consider if this move is needed at all, generalizing in the existing file is ok.

Tom