@@ -340,20 +340,24 @@ static int add_or_reset_cxl_resource(struct resource *parent, struct resource *r
340340DEFINE_FREE (put_cxlrd , struct cxl_root_decoder * ,
341341 if (!IS_ERR_OR_NULL (_T )) put_device (& _T -> cxlsd .cxld .dev ))
342342DEFINE_FREE (del_cxl_resource , struct resource * , if (_T ) del_cxl_resource (_T ))
343- static int __cxl_parse_cfmws ( struct acpi_cedt_cfmws * cfmws ,
344- struct cxl_cfmws_context * ctx )
343+ static int cxl_parse_cfmws ( union acpi_subtable_headers * header , void * arg ,
344+ const unsigned long end )
345345{
346346 int target_map [CXL_DECODER_MAX_INTERLEAVE ];
347+ struct cxl_cfmws_context * ctx = arg ;
347348 struct cxl_port * root_port = ctx -> root_port ;
348349 struct cxl_cxims_context cxims_ctx ;
349350 struct device * dev = ctx -> dev ;
351+ struct acpi_cedt_cfmws * cfmws ;
350352 struct cxl_decoder * cxld ;
351353 unsigned int ways , i , ig ;
352354 int rc ;
353355
356+ cfmws = (struct acpi_cedt_cfmws * ) header ;
357+
354358 rc = cxl_acpi_cfmws_verify (dev , cfmws );
355359 if (rc )
356- return rc ;
360+ return 0 ;
357361
358362 rc = eiw_to_ways (cfmws -> interleave_ways , & ways );
359363 if (rc )
@@ -378,7 +382,7 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
378382 cxl_root_decoder_alloc (root_port , ways );
379383
380384 if (IS_ERR (cxlrd ))
381- return PTR_ERR ( cxlrd ) ;
385+ return 0 ;
382386
383387 cxld = & cxlrd -> cxlsd .cxld ;
384388 cxld -> flags = cfmws_to_decoder_flags (cfmws -> restrictions );
@@ -421,29 +425,16 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
421425 rc = cxl_decoder_add (cxld , target_map );
422426 if (rc )
423427 return rc ;
424- return cxl_root_decoder_autoremove (dev , no_free_ptr (cxlrd ));
425- }
426-
427- static int cxl_parse_cfmws (union acpi_subtable_headers * header , void * arg ,
428- const unsigned long end )
429- {
430- struct acpi_cedt_cfmws * cfmws = (struct acpi_cedt_cfmws * )header ;
431- struct cxl_cfmws_context * ctx = arg ;
432- struct device * dev = ctx -> dev ;
433- int rc ;
434-
435- rc = __cxl_parse_cfmws (cfmws , ctx );
436- if (rc )
437- dev_err (dev ,
438- "Failed to add decode range: [%#llx - %#llx] (%d)\n" ,
439- cfmws -> base_hpa ,
440- cfmws -> base_hpa + cfmws -> window_size - 1 , rc );
441- else
442- dev_dbg (dev , "decode range: node: %d range [%#llx - %#llx]\n" ,
443- phys_to_target_node (cfmws -> base_hpa ), cfmws -> base_hpa ,
444- cfmws -> base_hpa + cfmws -> window_size - 1 );
428+ rc = cxl_root_decoder_autoremove (dev , no_free_ptr (cxlrd ));
429+ if (rc ) {
430+ dev_err (dev , "Failed to add decode range: %pr" , res );
431+ return rc ;
432+ }
433+ dev_dbg (dev , "add: %s node: %d range [%#llx - %#llx]\n" ,
434+ dev_name (& cxld -> dev ),
435+ phys_to_target_node (cxld -> hpa_range .start ),
436+ cxld -> hpa_range .start , cxld -> hpa_range .end );
445437
446- /* never fail cxl_acpi load for a single window failure */
447438 return 0 ;
448439}
449440
0 commit comments