Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/lego_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion core/lego_port_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing port->address?

return -EINVAL;

port->dev.release = lego_port_release;
Expand Down
3 changes: 1 addition & 2 deletions ev3/ev3_ports_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down
3 changes: 1 addition & 2 deletions ev3/ev3_ports_in.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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[] = {
Expand Down
7 changes: 3 additions & 4 deletions ev3/ev3_ports_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want the atomic version here.

}

static struct dc_motor_ops ev3_output_port_motor_ops = {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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);

Expand All @@ -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[] = {
Expand Down
3 changes: 1 addition & 2 deletions ev3/legoev3_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 = {
Expand Down
7 changes: 3 additions & 4 deletions ev3/legoev3_sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand All @@ -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[] = {
Expand Down