diff --git a/core/lego_bus.c b/core/lego_bus.c index cce0456..f17d38f 100644 --- a/core/lego_bus.c +++ b/core/lego_bus.c @@ -173,7 +173,7 @@ static struct attribute *lego_bus_dev_attrs[] = { }; ATTRIBUTE_GROUPS(lego_bus_dev); -static int lego_bus_match(struct device *dev, struct device_driver *drv) +static int lego_bus_match(struct device *dev, const struct device_driver *drv) { struct lego_device *ldev = to_lego_device(dev); struct lego_device_driver *ldrv = to_lego_device_driver(drv); diff --git a/core/lego_port_class.c b/core/lego_port_class.c index ab526c0..5baa0dc 100644 --- a/core/lego_port_class.c +++ b/core/lego_port_class.c @@ -236,7 +236,7 @@ int lego_port_register(struct lego_port_device *port, { int err; - if (!port || !port->name || !port->address || !type || !parent) + if (!port || !port->name || !type || !parent) return -EINVAL; port->dev.release = lego_port_release; diff --git a/ev3/ev3_ports_core.c b/ev3/ev3_ports_core.c index 686c46b..ec3c21a 100644 --- a/ev3/ev3_ports_core.c +++ b/ev3/ev3_ports_core.c @@ -92,11 +92,10 @@ static int ev3_ports_probe(struct platform_device *pdev) return 0; } -static int ev3_ports_remove(struct platform_device *pdev) +static void ev3_ports_remove(struct platform_device *pdev) { of_platform_depopulate(&pdev->dev); - return 0; } static const struct of_device_id ev3_ports_dt_ids[] = { diff --git a/ev3/ev3_ports_in.c b/ev3/ev3_ports_in.c index 6ce733c..9640cb4 100644 --- a/ev3/ev3_ports_in.c +++ b/ev3/ev3_ports_in.c @@ -1254,7 +1254,7 @@ static int ev3_input_port_probe(struct platform_device *pdev) return err; } -static int ev3_input_port_remove(struct platform_device *pdev) +static void ev3_input_port_remove(struct platform_device *pdev) { struct ev3_input_port_data *data = dev_get_drvdata(&pdev->dev); @@ -1273,7 +1273,6 @@ static int ev3_input_port_remove(struct platform_device *pdev) iio_channel_release_all_cb(data->iio_cb); ev3_input_port_float(data); - return 0; } static const struct of_device_id ev3_input_port_dt_ids[] = { diff --git a/ev3/ev3_ports_out.c b/ev3/ev3_ports_out.c index 9d16239..3fb15b5 100644 --- a/ev3/ev3_ports_out.c +++ b/ev3/ev3_ports_out.c @@ -339,7 +339,7 @@ static int ev3_output_port_set_duty_cycle(void *context, unsigned duty) if (ret) return ret; - return pwm_apply_state(data->pwm, &state); + return pwm_apply_might_sleep(data->pwm, &state); } static struct dc_motor_ops ev3_output_port_motor_ops = { @@ -807,7 +807,7 @@ static int ev3_output_port_probe(struct platform_device *pdev) goto err_stop_iio_cb; } /* This lets us set the pwm duty cycle in an atomic context */ - pm_runtime_irq_safe(data->pwm->chip->dev); + pm_runtime_irq_safe(&data->pwm->chip->dev); data->out_port.name = ev3_output_port_type.name; snprintf(data->out_port.address, LEGO_NAME_SIZE, "%s", @@ -854,7 +854,7 @@ static int ev3_output_port_probe(struct platform_device *pdev) return err; } -static int ev3_output_port_remove(struct platform_device *pdev) +static void ev3_output_port_remove(struct platform_device *pdev) { struct ev3_output_port_data *data = dev_get_drvdata(&pdev->dev); @@ -873,7 +873,6 @@ static int ev3_output_port_remove(struct platform_device *pdev) iio_channel_stop_all_cb(data->iio_cb); iio_channel_release_all_cb(data->iio_cb); - return 0; } static const struct of_device_id ev3_output_port_dt_ids[] = { diff --git a/ev3/legoev3_i2c.c b/ev3/legoev3_i2c.c index 3ebd007..7b4678c 100644 --- a/ev3/legoev3_i2c.c +++ b/ev3/legoev3_i2c.c @@ -136,7 +136,7 @@ static int i2c_legoev3_probe(struct platform_device *pdev) return ret; } -static int i2c_legoev3_remove(struct platform_device *pdev) +static void i2c_legoev3_remove(struct platform_device *pdev) { struct i2c_adapter *adap = platform_get_drvdata(pdev); struct i2c_legoev3_algo_data *adata = adap->algo_data; @@ -148,7 +148,6 @@ static int i2c_legoev3_remove(struct platform_device *pdev) kfree(adata); kfree(adap); - return 0; } static struct platform_driver i2c_legoev3_driver = { diff --git a/ev3/legoev3_sound.c b/ev3/legoev3_sound.c index 94045fb..4973d38 100644 --- a/ev3/legoev3_sound.c +++ b/ev3/legoev3_sound.c @@ -664,7 +664,7 @@ static int snd_legoev3_probe(struct platform_device *pdev) pwm_apply_args(pwm); /* This lets us set the pwm duty cycle in an atomic context */ - pm_runtime_irq_safe(pwm->chip->dev); + pm_runtime_irq_safe(&pwm->chip->dev); err = pwm_enable(pwm); if (err < 0) { @@ -696,7 +696,7 @@ static int snd_legoev3_probe(struct platform_device *pdev) goto err_snd_card_new; sprintf(card->longname, "%s connected to %s", card->shortname, - dev_name(pwm->chip->dev)); + dev_name(&pwm->chip->dev)); err = snd_legoev3_create(card, pwm, ena_gpio); if (err < 0) { @@ -729,7 +729,7 @@ static int snd_legoev3_probe(struct platform_device *pdev) return err; } -static int snd_legoev3_remove(struct platform_device *pdev) +static void snd_legoev3_remove(struct platform_device *pdev) { struct snd_card *card = dev_get_drvdata(&pdev->dev); struct snd_legoev3 *chip = card->private_data; @@ -744,7 +744,6 @@ static int snd_legoev3_remove(struct platform_device *pdev) cancel_work_sync(&chip->disable_work); pwm_disable(chip->pwm); - return 0; } static const struct of_device_id of_snd_legoev3_match[] = {