misc: mark write buffer const

The write operation in misc_ops already takes a "const void *" buffer,
but misc_write() takes a mutable "void *".  There's no reason for this,
so make misc_write() consistent with the standard write() prototype.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
John Keeping 2022-01-11 17:04:49 +00:00 committed by Tom Rini
parent 6f08eee67f
commit e44d2f5df9
2 changed files with 2 additions and 2 deletions

View file

@ -26,7 +26,7 @@ int misc_read(struct udevice *dev, int offset, void *buf, int size)
return ops->read(dev, offset, buf, size); return ops->read(dev, offset, buf, size);
} }
int misc_write(struct udevice *dev, int offset, void *buf, int size) int misc_write(struct udevice *dev, int offset, const void *buf, int size)
{ {
const struct misc_ops *ops = device_get_ops(dev); const struct misc_ops *ops = device_get_ops(dev);

View file

@ -28,7 +28,7 @@ int misc_read(struct udevice *dev, int offset, void *buf, int size);
* *
* Return: number of bytes written if OK (may be < @size), -ve on error * Return: number of bytes written if OK (may be < @size), -ve on error
*/ */
int misc_write(struct udevice *dev, int offset, void *buf, int size); int misc_write(struct udevice *dev, int offset, const void *buf, int size);
/** /**
* misc_ioctl() - Assert command to the device, optional. * misc_ioctl() - Assert command to the device, optional.