From: Lee Trager Date: Mon, 12 May 2025 18:53:57 +0000 (-0700) Subject: pldmfw: Don't require send_package_data or send_component_table to be defined X-Git-Tag: v6.16-rc1~132^2~104^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e505e140738005715b1b20eb848711b21a1b3c76;p=thirdparty%2Fkernel%2Flinux.git pldmfw: Don't require send_package_data or send_component_table to be defined Not all drivers require send_package_data or send_component_table when updating firmware. Instead of forcing drivers to implement a stub allow these functions to go undefined. Signed-off-by: Lee Trager Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Acked-by: Jacob Keller Link: https://patch.msgid.link/20250512190109.2475614-2-lee@trager.us Signed-off-by: Paolo Abeni --- diff --git a/lib/pldmfw/pldmfw.c b/lib/pldmfw/pldmfw.c index 6264e2013f25e..b45ceb7257801 100644 --- a/lib/pldmfw/pldmfw.c +++ b/lib/pldmfw/pldmfw.c @@ -728,6 +728,9 @@ pldm_send_package_data(struct pldmfw_priv *data) struct pldmfw_record *record = data->matching_record; const struct pldmfw_ops *ops = data->context->ops; + if (!ops->send_package_data) + return 0; + return ops->send_package_data(data->context, record->package_data, record->package_data_len); } @@ -755,6 +758,9 @@ pldm_send_component_tables(struct pldmfw_priv *data) if (!test_bit(index, bitmap)) continue; + if (!data->context->ops->send_component_table) + continue; + /* determine whether this is the start, middle, end, or both * the start and end of the component tables */