Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: cs_dsp: Remove need for clients to supply

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

Clients of cs_dsp can provide optional callback function pointers, in
a struct cs_dsp_client_ops. The client had to provide a pointer to a
struct even if it didn't implement any of the callbacks.

+7
+6
drivers/firmware/cirrus/cs_dsp.c
··· 2329 2329 return 0; 2330 2330 } 2331 2331 2332 + static const struct cs_dsp_client_ops cs_dsp_default_client_ops = { 2333 + }; 2334 + 2332 2335 static int cs_dsp_common_init(struct cs_dsp *dsp) 2333 2336 { 2334 2337 int ret; ··· 2344 2341 INIT_LIST_HEAD(&dsp->ctl_list); 2345 2342 2346 2343 mutex_init(&dsp->pwr_lock); 2344 + 2345 + if (!dsp->client_ops) 2346 + dsp->client_ops = &cs_dsp_default_client_ops; 2347 2347 2348 2348 #ifdef CONFIG_DEBUG_FS 2349 2349 /* Ensure this is invalid if client never provides a debugfs root */
+1
drivers/firmware/cirrus/test/cs_dsp_test_callbacks.c
··· 600 600 601 601 static const struct cs_dsp_callbacks_test_param cs_dsp_no_callbacks_cases[] = { 602 602 { .ops = &cs_dsp_callback_test_empty_client_ops, .case_name = "empty ops" }, 603 + { .ops = NULL, .case_name = "NULL ops" }, 603 604 }; 604 605 605 606 KUNIT_ARRAY_PARAM(cs_dsp_no_callbacks,