usermode: Rework Z_SYSCALL_SPECIFIC_DRIVER to fit with device refactoring

init_fn is not anymore part of struct device, so let's test instead the
driver's API structure pointer which is also unique per device driver.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2020-03-13 09:53:54 +01:00 committed by Carles Cufí
commit 48135cdd34
3 changed files with 10 additions and 11 deletions

View file

@ -1339,7 +1339,7 @@ int z_vrfy_maxim_ds3231_get_syncpoint(struct device *dev,
struct maxim_ds3231_syncpoint value;
int rv;
Z_OOPS(Z_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, ds3231_init));
Z_OOPS(Z_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api));
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(syncpoint, sizeof(*syncpoint)));
rv = z_impl_maxim_ds3231_get_syncpoint(dev, &value);
@ -1356,7 +1356,7 @@ int z_vrfy_maxim_ds3231_get_syncpoint(struct device *dev,
int z_vrfy_maxim_ds3231_req_syncpoint(struct device *dev,
struct k_poll_signal *sig)
{
Z_OOPS(Z_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, ds3231_init));
Z_OOPS(Z_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api));
if (sig != NULL) {
Z_OOPS(Z_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
}