ret = apb_ctrl_coldboot(dev);
if (ret)
- dev_warn(dev, "failed to coldboot\n");
+ dev_warn(dev, "Failed to coldboot\n");
/*Child nodes are independent, so do not exit coldboot operation */
return 0;
/* Enable HUB3613 into HUB mode. */
if (usb3613_hub_mode_ctrl(false))
- dev_warn(dev, "failed to control hub device\n");
+ dev_warn(dev, "Failed to control hub device\n");
return 0;
}
/* Enable HUB3613 into HUB mode. */
if (usb3613_hub_mode_ctrl(true))
- dev_warn(arche_pdata->dev, "failed to control hub device\n");
+ dev_warn(arche_pdata->dev, "Failed to control hub device\n");
spin_lock_irqsave(&arche_pdata->wake_lock, flags);
arche_platform_set_wake_detect_state(arche_pdata, WD_STATE_IDLE);
ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
if (ret) {
- dev_err(arche_pdata->dev, "failed to enable svc_ref_clk: %d\n",
+ dev_err(arche_pdata->dev, "Failed to enable svc_ref_clk: %d\n",
ret);
return ret;
}
- /* bring SVC out of reset */
+ /* Bring SVC out of reset */
svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_ACTIVE);
ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
if (ret) {
- dev_err(arche_pdata->dev, "failed to enable svc_ref_clk: %d\n",
+ dev_err(arche_pdata->dev, "Failed to enable svc_ref_clk: %d\n",
ret);
return ret;
}
if (arche_pdata->state == ARCHE_PLATFORM_STATE_STANDBY)
goto exit;
- dev_warn(arche_pdata->dev, "standby state not supported\n");
+ dev_warn(arche_pdata->dev, "Standby state not supported\n");
} else if (sysfs_streq(buf, "fw_flashing")) {
if (arche_pdata->state == ARCHE_PLATFORM_STATE_FW_FLASHING)
goto exit;
if (ret)
goto exit;
} else {
- dev_err(arche_pdata->dev, "unknown state\n");
+ dev_err(arche_pdata->dev, "Unknown state\n");
ret = -EINVAL;
}
if (!arche_pdata)
return -ENOMEM;
- /* setup svc reset gpio */
+ /* Setup svc reset gpio */
arche_pdata->is_reset_act_hi = of_property_read_bool(np,
"svc,reset-active-high");
if (arche_pdata->is_reset_act_hi)
arche_pdata->svc_reset = devm_gpiod_get(dev, "svc,reset", flags);
if (IS_ERR(arche_pdata->svc_reset)) {
ret = PTR_ERR(arche_pdata->svc_reset);
- dev_err(dev, "failed to request svc-reset GPIO: %d\n", ret);
+ dev_err(dev, "Failed to request svc-reset GPIO: %d\n", ret);
return ret;
}
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_OFF);
GPIOD_OUT_LOW);
if (IS_ERR(arche_pdata->svc_sysboot)) {
ret = PTR_ERR(arche_pdata->svc_sysboot);
- dev_err(dev, "failed to request sysboot0 GPIO: %d\n", ret);
+ dev_err(dev, "Failed to request sysboot0 GPIO: %d\n", ret);
return ret;
}
- /* setup the clock request gpio first */
+ /* Setup the clock request gpio first */
arche_pdata->svc_refclk_req = devm_gpiod_get(dev, "svc,refclk-req",
GPIOD_IN);
if (IS_ERR(arche_pdata->svc_refclk_req)) {
ret = PTR_ERR(arche_pdata->svc_refclk_req);
- dev_err(dev, "failed to request svc-clk-req GPIO: %d\n", ret);
+ dev_err(dev, "Failed to request svc-clk-req GPIO: %d\n", ret);
return ret;
}
arche_pdata->svc_ref_clk = devm_clk_get(dev, "svc_ref_clk");
if (IS_ERR(arche_pdata->svc_ref_clk)) {
ret = PTR_ERR(arche_pdata->svc_ref_clk);
- dev_err(dev, "failed to get svc_ref_clk: %d\n", ret);
+ dev_err(dev, "Failed to get svc_ref_clk: %d\n", ret);
return ret;
}
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
dev_name(dev), arche_pdata);
if (ret) {
- dev_err(dev, "failed to request wake detect IRQ %d\n", ret);
+ dev_err(dev, "Failed to request wake detect IRQ %d\n", ret);
return ret;
}
disable_irq(arche_pdata->wake_detect_irq);
ret = device_create_file(dev, &dev_attr_state);
if (ret) {
- dev_err(dev, "failed to create state file in sysfs\n");
+ dev_err(dev, "Failed to create state file in sysfs\n");
return ret;
}
ret = of_platform_populate(np, NULL, NULL, dev);
if (ret) {
- dev_err(dev, "failed to populate child nodes %d\n", ret);
+ dev_err(dev, "Failed to populate child nodes %d\n", ret);
goto err_device_remove;
}
ret = register_pm_notifier(&arche_pdata->pm_notifier);
if (ret) {
- dev_err(dev, "failed to register pm notifier %d\n", ret);
+ dev_err(dev, "Failed to register pm notifier %d\n", ret);
goto err_device_remove;
}
arche_platform_poweroff_seq(arche_pdata);
if (usb3613_hub_mode_ctrl(false))
- dev_warn(arche_pdata->dev, "failed to control hub device\n");
+ dev_warn(arche_pdata->dev, "Failed to control hub device\n");
}
static __maybe_unused int arche_platform_suspend(struct device *dev)
ret = gb_operation_sync(connection, GB_CAP_TYPE_GET_ENDPOINT_UID, NULL,
0, &response, sizeof(response));
if (ret) {
- dev_err(cap->parent, "failed to get endpoint uid (%d)\n", ret);
+ dev_err(cap->parent, "Failed to get endpoint uid (%d)\n", ret);
return ret;
}
ret = gb_operation_request_send_sync(op);
if (ret) {
- dev_err(cap->parent, "failed to get certificate (%d)\n", ret);
+ dev_err(cap->parent, "Failed to get certificate (%d)\n", ret);
goto done;
}
ret = gb_operation_request_send_sync(op);
if (ret) {
- dev_err(cap->parent, "failed to authenticate (%d)\n", ret);
+ dev_err(cap->parent, "Failed to authenticate (%d)\n", ret);
goto done;
}
&connection->bundle->dev);
if (rc) {
dev_err(&connection->bundle->dev,
- "failed to find %s firmware (%d)\n", firmware_name, rc);
+ "Failed to find %s firmware (%d)\n", firmware_name, rc);
}
return rc;
size = le32_to_cpu(firmware_request->size);
if (offset >= fw->size || size > fw->size - offset) {
- dev_warn(dev, "bad firmware request (offs = %u, size = %u)\n",
+ dev_warn(dev, "Bad firmware request (offs = %u, size = %u)\n",
offset, size);
ret = -EINVAL;
goto unlock;
firmware_response = op->response->payload;
memcpy(firmware_response, fw->data + offset, size);
- dev_dbg(dev, "responding with firmware (offs = %u, size = %u)\n",
+ dev_dbg(dev, "Responding with firmware (offs = %u, size = %u)\n",
offset, size);
unlock:
/*
* XXX Should we return error for insecure firmware?
*/
- dev_dbg(dev, "ready to boot: 0x%x, 0\n", status);
+ dev_dbg(dev, "Ready to boot: 0x%x, 0\n", status);
queue_work:
/*
return gb_bootrom_ready_to_boot(op);
default:
dev_err(&op->connection->bundle->dev,
- "unsupported request: %u\n", type);
+ "Unsupported request: %u\n", type);
return -EINVAL;
}
}
sizeof(response));
if (ret) {
dev_err(&bundle->dev,
- "failed to get protocol version: %d\n",
+ "Failed to get protocol version: %d\n",
ret);
return ret;
}
if (response.major > request.major) {
dev_err(&bundle->dev,
- "unsupported major protocol version (%u > %u)\n",
+ "Unsupported major protocol version (%u > %u)\n",
response.major, request.major);
return -ENOTSUPP;
}
NULL, 0);
if (ret) {
dev_err(&connection->bundle->dev,
- "failed to send AP READY: %d\n", ret);
+ "Failed to send AP READY: %d\n", ret);
goto err_cancel_timeout;
}
\
ret = kstrtou8(buf, 0, &fade); \
if (ret < 0) { \
- dev_err(dev, "could not parse fade value %d\n", ret); \
+ dev_err(dev, "Could not parse fade value %d\n", ret); \
goto unlock; \
} \
if (channel->fade_##__dir == fade) \
}
ret = kstrtou32(buf, 0, &color);
if (ret < 0) {
- dev_err(dev, "could not parse color value %d\n", ret);
+ dev_err(dev, "Could not parse color value %d\n", ret);
goto unlock;
}
else
channel->active = false;
- /* we need to keep module alive when turning to active state */
+ /* We need to keep module alive when turning to active state */
if (!old_active && channel->active)
goto out_unlock;
/*
- * on the other hand if going to inactive we still hold a reference and
+ * On the other hand if going to inactive we still hold a reference and
* need to put it, so we could go to suspend.
*/
if (old_active && !channel->active)
else
channel->active = false;
- /* we need to keep module alive when turning to active state */
+ /* We need to keep module alive when turning to active state. */
if (!old_active && channel->active)
goto out_unlock;
/*
- * on the other hand if going to inactive we still hold a reference and
+ * On the other hand if going to inactive we still hold a reference and
* need to put it, so we could go to suspend.
*/
if (old_active && !channel->active)
channel_flash = get_channel_from_mode(light, GB_CHANNEL_MODE_FLASH);
if (!channel_flash) {
- dev_err(dev, "failed to get flash channel from mode\n");
+ dev_err(dev, "Failed to get flash channel from mode\n");
return -EINVAL;
}
{
struct gb_connection *connection = get_conn_from_light(light);
- dev_err(&connection->bundle->dev, "no support for v4l2 subdevices\n");
+ dev_err(&connection->bundle->dev, "No support for v4l2 subdevices\n");
return 0;
}
{
char *name;
- /* we can only attach torch to a flash channel */
+ /* We can only attach torch to a flash channel */
if (!(channel->mode & GB_CHANNEL_MODE_FLASH))
return 0;
/* Move torch brightness to the destination */
channel->led->max_brightness = channel_torch->led->max_brightness;
- /* append mode name to flash name */
+ /* Append mode name to flash name */
name = kasprintf(GFP_KERNEL, "%s_%s", channel->led->name,
channel_torch->mode_name);
if (!name)
/*
* If light have torch mode channel, this channel will be the led
- * classdev of the registered above flash classdev
+ * classdev of the registered above flash classdev.
*/
channel_torch = get_channel_from_mode(channel->light,
GB_CHANNEL_MODE_TORCH);
*/
channel->led->max_brightness = (fset->max - fset->min) / fset->step;
- /* Only the flash mode have the timeout constraints settings */
+ /* Only the flash mode have the timeout constraints settings. */
if (channel->mode & GB_CHANNEL_MODE_FLASH) {
fset = &channel->timeout_us;
fset->min = le32_to_cpu(conf.timeout_min_us);
{
struct gb_connection *connection = get_conn_from_channel(channel);
- dev_err(&connection->bundle->dev, "no support for flash devices\n");
+ dev_err(&connection->bundle->dev, "No support for flash devices\n");
return 0;
}
u16 len;
if (op->type != GB_LOG_TYPE_SEND_LOG) {
- dev_err(dev, "unknown request type 0x%02x\n", op->type);
+ dev_err(dev, "Unknown request type 0x%02x\n", op->type);
return -EINVAL;
}
/* Verify size of payload */
if (op->request->payload_size < sizeof(*receive)) {
- dev_err(dev, "log request too small (%zu < %zu)\n",
+ dev_err(dev, "Log request too small (%zu < %zu)\n",
op->request->payload_size, sizeof(*receive));
return -EINVAL;
}
receive = op->request->payload;
len = le16_to_cpu(receive->len);
if (len != (op->request->payload_size - sizeof(*receive))) {
- dev_err(dev, "log request wrong size %d vs %zu\n", len,
+ dev_err(dev, "Log request wrong size %d vs %zu\n", len,
(op->request->payload_size - sizeof(*receive)));
return -EINVAL;
}
if (len == 0) {
- dev_err(dev, "log request of 0 bytes?\n");
+ dev_err(dev, "Log request of 0 bytes?\n");
return -EINVAL;
}
if (len > GB_LOG_MAX_LEN) {
- dev_err(dev, "log request too big: %d\n", len);
+ dev_err(dev, "Log request too big: %d\n", len);
return -EINVAL;
}