mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	drm/panel/lg-sw43408: Use refcounted allocation in place of devm_kzalloc()
Move to using the new API devm_drm_panel_alloc() to allocate the panel. In the call to the new API, avoid using explicit type and use __typeof() for more type safety. Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> Link: https://lore.kernel.org/r/20250710-b4-driver-convert-last-part-july-v1-6-de73ba81b2f5@redhat.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
		
							parent
							
								
									a8f268ac9d
								
							
						
					
					
						commit
						daeca2b7c7
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -246,8 +246,6 @@ static int sw43408_add(struct sw43408_panel *ctx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx->base.prepare_prev_first = true;
 | 
						ctx->base.prepare_prev_first = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	drm_panel_init(&ctx->base, dev, &sw43408_funcs, DRM_MODE_CONNECTOR_DSI);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	drm_panel_add(&ctx->base);
 | 
						drm_panel_add(&ctx->base);
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -257,9 +255,11 @@ static int sw43408_probe(struct mipi_dsi_device *dsi)
 | 
				
			||||||
	struct sw43408_panel *ctx;
 | 
						struct sw43408_panel *ctx;
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL);
 | 
						ctx = devm_drm_panel_alloc(&dsi->dev, __typeof(*ctx), base,
 | 
				
			||||||
	if (!ctx)
 | 
									   &sw43408_funcs, DRM_MODE_CONNECTOR_DSI);
 | 
				
			||||||
		return -ENOMEM;
 | 
					
 | 
				
			||||||
 | 
						if (IS_ERR(ctx))
 | 
				
			||||||
 | 
							return PTR_ERR(ctx);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dsi->mode_flags = MIPI_DSI_MODE_LPM;
 | 
						dsi->mode_flags = MIPI_DSI_MODE_LPM;
 | 
				
			||||||
	dsi->format = MIPI_DSI_FMT_RGB888;
 | 
						dsi->format = MIPI_DSI_FMT_RGB888;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue