Re: [PATCH v3 12/18] usb: typec: ucsi: acpi: Move to the new API

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

 



Hi,

On Sat, Nov 02, 2019 at 09:31:29AM -0700, Guenter Roeck wrote:
> > -static int ucsi_acpi_cmd(struct ucsi_ppm *ppm, struct ucsi_control *ctrl)
> > +static int ucsi_acpi_read(struct ucsi *ucsi, unsigned int offset,
> > +			  void *val, size_t val_len)
> >   {
> > -	struct ucsi_acpi *ua = container_of(ppm, struct ucsi_acpi, ppm);
> > +	struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
> > +	int ret;
> > +
> > +	ret = ucsi_acpi_dsm(ua, UCSI_DSM_FUNC_READ);
> > +	if (ret)
> > +		return ret;
> > +
> > +	memcpy(val, (const void __force *)(ua->base + offset), val_len);
> > +
> 
> Would it be better to use memcpy_fromio() and memcpy_toio() if
> ua->base indeed points to iomem ?

No, it's not really iomem. It's just supplied to the driver as such.

thanks,

-- 
heikki



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux