本文整理汇总了C++中DEV_ERR函数的典型用法代码示例。如果您正苦于以下问题:C++ DEV_ERR函数的具体用法?C++ DEV_ERR怎么用?C++ DEV_ERR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DEV_ERR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: msm_dss_clk_set_rate
int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk)
{
int i, rc = 0;
for (i = 0; i < num_clk; i++) {
if (clk_arry[i].clk) {
if (DSS_CLK_AHB != clk_arry[i].type) {
DEV_DBG("%pS->%s: '%s' rate %ld\n",
__builtin_return_address(0), __func__,
clk_arry[i].clk_name,
clk_arry[i].rate);
rc = clk_set_rate(clk_arry[i].clk,
clk_arry[i].rate);
if (rc) {
DEV_ERR("%pS->%s: %s failed. rc=%d\n",
__builtin_return_address(0),
__func__,
clk_arry[i].clk_name, rc);
break;
}
}
} else {
DEV_ERR("%pS->%s: '%s' is not available\n",
__builtin_return_address(0), __func__,
clk_arry[i].clk_name);
rc = -EPERM;
break;
}
}
return rc;
} /* msm_dss_clk_set_rate */
示例2: msm_dss_ioremap_byname
int msm_dss_ioremap_byname(struct platform_device *pdev,
struct dss_io_data *io_data, const char *name)
{
struct resource *res = NULL;
if (!pdev || !io_data) {
DEV_ERR("%pS->%s: invalid input\n",
__builtin_return_address(0), __func__);
return -EINVAL;
}
res = msm_dss_get_res_byname(pdev, IORESOURCE_MEM, name);
if (!res) {
DEV_ERR("%pS->%s: '%s' msm_dss_get_res_byname failed\n",
__builtin_return_address(0), __func__, name);
return -ENODEV;
}
io_data->len = resource_size(res);
io_data->base = ioremap(res->start, io_data->len);
if (!io_data->base) {
DEV_ERR("%pS->%s: '%s' ioremap failed\n",
__builtin_return_address(0), __func__, name);
return -EIO;
}
return 0;
} /* msm_dss_ioremap_byname */
示例3: nfcsim_wq_recv
static void nfcsim_wq_recv(struct work_struct *work)
{
struct nfcsim *dev = container_of(work, struct nfcsim,
recv_work.work);
mutex_lock(&dev->lock);
if (dev->shutting_down || !dev->up || !dev->clone_skb) {
dev_kfree_skb(dev->clone_skb);
goto exit;
}
if (dev->initiator) {
if (!dev->cb) {
DEV_ERR(dev, "Null recv callback\n");
dev_kfree_skb(dev->clone_skb);
goto exit;
}
dev->cb(dev->cb_context, dev->clone_skb, 0);
dev->cb = NULL;
} else {
nfc_tm_data_received(dev->nfc_dev, dev->clone_skb);
}
exit:
dev->clone_skb = NULL;
mutex_unlock(&dev->lock);
}
示例4: sp_write_reg
int sp_write_reg(uint8_t slave_addr, uint8_t offset, uint8_t value)
{
int ret = 0;
//printk("=======sp_write_reg ====%x====%x\n",slave_addr,offset);
if ( (g_i2c_error_count > 20) || (g_tx_recovery_process))
return -1;
anx7808_client->addr = (slave_addr >> 1);
ret = i2c_smbus_write_byte_data(anx7808_client, offset, value);
if (ret < 0) {
DEV_ERR("%s: failed to write i2c addr=%x\n",
__func__, slave_addr);
if ((++g_i2c_error_count) > 20)
{
printk("myDP write i2c error, power down\n");
sp_tx_hardware_recovery(anx7808_client);
}
}
else
{
g_i2c_error_count = 0;
g_tx_recovery_process = 0;
}
return ret;
}
示例5: dsi_ctrl_config_init
int dsi_ctrl_config_init(struct platform_device *pdev,
struct mdss_dsi_ctrl_pdata *ctrl_pdata)
{
int rc = 0, i;
for (i = 0; i < DSI_MAX_PM; i++) {
rc = mdss_dsi_get_dt_vreg_data(&pdev->dev,
&ctrl_pdata->power_data[i], i);
if (rc) {
DEV_ERR("%s: '%s' get_dt_vreg_data failed.rc=%d\n",
__func__, __mdss_dsi_pm_name(i), rc);
return rc;
}
}
rc = dsi_parse_gpio(pdev, ctrl_pdata);
if (rc) {
pr_err("fail to parse panel GPIOs\n");
return rc;
}
rc = dsi_parse_phy(pdev, ctrl_pdata);
if (rc) {
pr_err("fail to parse DSI PHY settings\n");
return rc;
}
return 0;
}
示例6: tvout_init
static int __init tvout_init(void)
{
int ret;
tvout_msm_state = kzalloc(sizeof(*tvout_msm_state), GFP_KERNEL);
if (!tvout_msm_state) {
DEV_ERR("tvout_msm_init FAILED: out of memory\n");
ret = -ENOMEM;
goto init_exit;
}
external_common_state = &tvout_msm_state->common;
ret = platform_driver_register(&this_driver);
if (ret) {
DEV_ERR("tvout_device_init FAILED: platform_driver_register\
rc=%d\n", ret);
goto init_exit;
}
ret = platform_device_register(&this_device);
if (ret) {
DEV_ERR("tvout_device_init FAILED: platform_driver_register\
rc=%d\n", ret);
platform_driver_unregister(&this_driver);
goto init_exit;
}
INIT_WORK(&tvout_msm_state->hpd_work, tvout_msm_hpd_work);
return 0;
init_exit:
kfree(tvout_msm_state);
tvout_msm_state = NULL;
return ret;
}
示例7: msm_dss_enable_clk
int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable)
{
int i, rc = 0;
if (enable) {
for (i = 0; i < num_clk; i++) {
DEV_DBG("%pS->%s: enable '%s'\n",
__builtin_return_address(0), __func__,
clk_arry[i].clk_name);
if (clk_arry[i].clk) {
rc = clk_prepare_enable(clk_arry[i].clk);
if (rc)
DEV_ERR("%pS->%s: %s en fail. rc=%d\n",
__builtin_return_address(0),
__func__,
clk_arry[i].clk_name, rc);
} else {
DEV_ERR("%pS->%s: '%s' is not available\n",
__builtin_return_address(0), __func__,
clk_arry[i].clk_name);
rc = -EPERM;
}
if (rc) {
msm_dss_enable_clk(&clk_arry[i],
i, false);
break;
}
}
} else {
for (i = num_clk - 1; i >= 0; i--) {
DEV_DBG("%pS->%s: disable '%s'\n",
__builtin_return_address(0), __func__,
clk_arry[i].clk_name);
if (clk_arry[i].clk)
clk_disable_unprepare(clk_arry[i].clk);
else
DEV_ERR("%pS->%s: '%s' is not available\n",
__builtin_return_address(0), __func__,
clk_arry[i].clk_name);
}
}
return rc;
} /* msm_dss_enable_clk */
示例8: slimport_edid_proc
static void slimport_edid_proc(void)
{
sp_tx_edid_read();
if (bedid_break)
DEV_ERR("%s: EDID corruption!\n", __func__);
hdmi_rx_set_hpd(1);
hdmi_rx_set_termination(1);
sp_tx_set_sys_state(STATE_CONFIG_HDMI);
}
示例9: pci_dev_init_manager
static void pci_dev_init_manager(struct device_mem *bar_info,
int nr_mapped_bars)
{
errval_t err;
DEV_DEBUG("Initialize device @ [%016lx] with %u bars\n", bar_info->paddr,
nr_mapped_bars);
if (nr_mapped_bars != 1) {
DEV_ERR("number of mapped bars is wrong. Skipping initialization\n");
return;
}
err = ioat_mgr_svc_add_device(bar_info->frame_cap);
if (err_is_fail(err)) {
DEV_ERR("Device coult not be added to the manager: %s\n",
err_getstring(err));
}
}
示例10: nfcsim_dep_link_up
static int nfcsim_dep_link_up(struct nfc_dev *nfc_dev,
struct nfc_target *target,
u8 comm_mode, u8 *gb, size_t gb_len)
{
int rc;
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
struct nfcsim *peer = dev->peer_dev;
u8 *remote_gb;
size_t remote_gb_len;
DEV_DBG(dev, "target_idx: %d, comm_mode: %d\n", target->idx, comm_mode);
mutex_lock(&peer->lock);
nfc_tm_activated(peer->nfc_dev, NFC_PROTO_NFC_DEP_MASK,
NFC_COMM_ACTIVE, gb, gb_len);
remote_gb = nfc_get_local_general_bytes(peer->nfc_dev, &remote_gb_len);
if (!remote_gb) {
DEV_ERR(peer, "Can't get remote general bytes\n");
mutex_unlock(&peer->lock);
return -EINVAL;
}
mutex_unlock(&peer->lock);
mutex_lock(&dev->lock);
rc = nfc_set_remote_general_bytes(nfc_dev, remote_gb, remote_gb_len);
if (rc) {
DEV_ERR(dev, "Can't set remote general bytes\n");
mutex_unlock(&dev->lock);
return rc;
}
rc = nfc_dep_link_is_up(nfc_dev, target->idx, NFC_COMM_ACTIVE,
NFC_RF_INITIATOR);
mutex_unlock(&dev->lock);
return rc;
}
示例11: platform_get_resource_byname
static struct resource *msm_dss_get_res_byname(struct platform_device *pdev,
unsigned int type, const char *name)
{
struct resource *res = NULL;
res = platform_get_resource_byname(pdev, type, name);
if (!res)
DEV_ERR("%s: '%s' resource not found\n", __func__, name);
return res;
} /* msm_dss_get_res_byname */
示例12: dss_reg_r
u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug)
{
u32 value;
if (!io || !io->base) {
DEV_ERR("%pS->%s: invalid input\n",
__builtin_return_address(0), __func__);
return -EINVAL;
}
if (offset > io->len) {
DEV_ERR("%pS->%s: offset out of range\n",
__builtin_return_address(0), __func__);
return -EINVAL;
}
value = readl_relaxed(io->base + offset);
if (debug)
DEV_DBG("[%08x] <= %08x\n", (u32)(io->base + offset), value);
return value;
} /* dss_reg_r */
示例13: hdmi_common_state_create
/* create HDMI kobject and initialize */
int hdmi_common_state_create(struct platform_device *pdev)
{
int rc;
struct msm_fb_data_type *mfd = platform_get_drvdata(pdev);
rc = sysfs_create_group(&mfd->fbi->dev->kobj,
&hdmi_common_fs_attr_group);
if (rc) {
DEV_ERR("%s: sysfs group creation failed, rc=%d\n", __func__,
rc);
return rc;
}
hdmi_common_state->uevent_kobj = &mfd->fbi->dev->kobj;
DEV_ERR("%s: sysfs group %p\n", __func__,
hdmi_common_state->uevent_kobj);
kobject_uevent(hdmi_common_state->uevent_kobj, KOBJ_ADD);
DEV_DBG("%s: kobject_uevent(KOBJ_ADD)\n", __func__);
return 0;
}
示例14: nfcsim_start_poll
static int nfcsim_start_poll(struct nfc_dev *nfc_dev,
u32 im_protocols, u32 tm_protocols)
{
struct nfcsim *dev = nfc_get_drvdata(nfc_dev);
int rc;
mutex_lock(&dev->lock);
if (dev->polling_mode != NFCSIM_POLL_NONE) {
DEV_ERR(dev, "Already in polling mode\n");
rc = -EBUSY;
goto exit;
}
if (im_protocols & NFC_PROTO_NFC_DEP_MASK)
dev->polling_mode |= NFCSIM_POLL_INITIATOR;
if (tm_protocols & NFC_PROTO_NFC_DEP_MASK)
dev->polling_mode |= NFCSIM_POLL_TARGET;
if (dev->polling_mode == NFCSIM_POLL_NONE) {
DEV_ERR(dev, "Unsupported polling mode\n");
rc = -EINVAL;
goto exit;
}
dev->initiator = 0;
dev->curr_polling_mode = NFCSIM_POLL_NONE;
queue_delayed_work(wq, &dev->poll_work, 0);
DEV_DBG(dev, "Start polling: im: 0x%X, tm: 0x%X\n", im_protocols,
tm_protocols);
rc = 0;
exit:
mutex_unlock(&dev->lock);
return rc;
}
示例15: pci_dev_init_service
static void pci_dev_init_service(struct device_mem *bar_info,
int nr_mapped_bars)
{
errval_t err;
DEV_DEBUG("Initialize device @ [%016lx] with %u bars\n", bar_info->paddr,
nr_mapped_bars);
if (nr_mapped_bars != 1) {
DEV_ERR("number of mapped bars is wrong. Skipping initialization\n");
return;
}
/* initialize the device */
err = ioat_dma_device_init(*bar_info->frame_cap, &devices[device_count]);
if (err_is_fail(err)) {
DEV_ERR("Could not initialize the device: %s\n", err_getstring(err));
return;
}
device_count++;
}