Re: [PATCH v4 6/8] ACPI: property: Rename parsed MIPI DisCo for Imaging properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 08, 2023 at 06:56:27PM +0200, Andy Shevchenko wrote:
> On Wed, Feb 08, 2023 at 05:28:05PM +0200, Sakari Ailus wrote:
> > MIPI DisCo for Imaging defines properties for sensor-adjacent devices such
> > as EEPROM, LED flash or lens VCM as either device or sub-node references.
> > This is compliant with existing DT definitions apart from property names.
> > 
> > Rename parsed MIPI-defined properties so drivers will have a unified view
> > of them as defined in DT and already parsed by drivers. This can be done
> > in-place as the MIPI-defined property strings are always longer than the
> > DT one. This also results in loss of constness in parser function
> > arguments.
> > 
> > Individual bindings to devices could define the references differently
> > between MIPI DisCo for Imaging and DT, in terms of device or sub-node
> > references. This will still need to be handled in the drivers themselves.
> 
> ...
> 
> > +void acpi_properties_prepare_mipi(union acpi_object *elements)
> > +{
> > +	unsigned int i;
> > +
> > +	/* Replace MIPI DisCo for Imaging property names with DT equivalents. */
> > +	for (i = 0; i < ARRAY_SIZE(mipi_disco_props); i++) {
> > +		if (!strcmp(mipi_disco_props[i].mipi_prop,
> > +			    elements[0].string.pointer)) {
> 
> 	/* const ? */ char *e0 = elements[0].string.pointer;

Yes, and can be placed outside the loop.

> 	...
> 
> 		if (!strcmp(mipi_disco_props[i].mipi_prop, e0)) {
> 
> > +			WARN_ON(strscpy(elements[0].string.pointer,
> > +					mipi_disco_props[i].dt_prop,
> > +					elements[0].string.length) < 0);
> 
> 			WARN_ON(strscpy(e0, mipi_disco_props[i].dt_prop,
> 					elements[0].string.pointer) < 0);
> ?
> 
> > +			break;
> > +		}
> > +	}
> > +}
> 

-- 
Sakari Ailus



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux