提交 cfeecab4 编写于 作者: L LABBE Corentin 提交者: Herbert Xu

crypto: hifn_795x - use dev_xx/pr_xx instead of printk

This patch replace all printk by their dev_xx/pr_xx counterpart.
The patch remove also all custom dprintk by pr_debug/dev_debug
Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 276a2ff1
...@@ -36,14 +36,6 @@ ...@@ -36,14 +36,6 @@
#include <crypto/algapi.h> #include <crypto/algapi.h>
#include <crypto/des.h> #include <crypto/des.h>
//#define HIFN_DEBUG
#ifdef HIFN_DEBUG
#define dprintk(f, a...) printk(f, ##a)
#else
#define dprintk(f, a...) do {} while (0)
#endif
static char hifn_pll_ref[sizeof("extNNN")] = "ext"; static char hifn_pll_ref[sizeof("extNNN")] = "ext";
module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444); module_param_string(hifn_pll_ref, hifn_pll_ref, sizeof(hifn_pll_ref), 0444);
MODULE_PARM_DESC(hifn_pll_ref, MODULE_PARM_DESC(hifn_pll_ref,
...@@ -702,7 +694,7 @@ static void hifn_wait_puc(struct hifn_device *dev) ...@@ -702,7 +694,7 @@ static void hifn_wait_puc(struct hifn_device *dev)
} }
if (!i) if (!i)
dprintk("%s: Failed to reset PUC unit.\n", dev->name); dev_err(&dev->pdev->dev, "Failed to reset PUC unit.\n");
} }
static void hifn_reset_puc(struct hifn_device *dev) static void hifn_reset_puc(struct hifn_device *dev)
...@@ -854,15 +846,13 @@ static int hifn_init_pubrng(struct hifn_device *dev) ...@@ -854,15 +846,13 @@ static int hifn_init_pubrng(struct hifn_device *dev)
} }
if (!i) if (!i)
dprintk("Chip %s: Failed to initialise public key engine.\n", dev_err(&dev->pdev->dev, "Failed to initialise public key engine.\n");
dev->name);
else { else {
hifn_write_1(dev, HIFN_1_PUB_IEN, HIFN_PUBIEN_DONE); hifn_write_1(dev, HIFN_1_PUB_IEN, HIFN_PUBIEN_DONE);
dev->dmareg |= HIFN_DMAIER_PUBDONE; dev->dmareg |= HIFN_DMAIER_PUBDONE;
hifn_write_1(dev, HIFN_1_DMA_IER, dev->dmareg); hifn_write_1(dev, HIFN_1_DMA_IER, dev->dmareg);
dprintk("Chip %s: Public key engine has been successfully " dev_dbg(&dev->pdev->dev, "Public key engine has been successfully initialised.\n");
"initialised.\n", dev->name);
} }
/* /*
...@@ -871,8 +861,7 @@ static int hifn_init_pubrng(struct hifn_device *dev) ...@@ -871,8 +861,7 @@ static int hifn_init_pubrng(struct hifn_device *dev)
hifn_write_1(dev, HIFN_1_RNG_CONFIG, hifn_write_1(dev, HIFN_1_RNG_CONFIG,
hifn_read_1(dev, HIFN_1_RNG_CONFIG) | HIFN_RNGCFG_ENA); hifn_read_1(dev, HIFN_1_RNG_CONFIG) | HIFN_RNGCFG_ENA);
dprintk("Chip %s: RNG engine has been successfully initialised.\n", dev_dbg(&dev->pdev->dev, "RNG engine has been successfully initialised.\n");
dev->name);
#ifdef CONFIG_CRYPTO_DEV_HIFN_795X_RNG #ifdef CONFIG_CRYPTO_DEV_HIFN_795X_RNG
/* First value must be discarded */ /* First value must be discarded */
...@@ -897,7 +886,7 @@ static int hifn_enable_crypto(struct hifn_device *dev) ...@@ -897,7 +886,7 @@ static int hifn_enable_crypto(struct hifn_device *dev)
} }
if (offtbl == NULL) { if (offtbl == NULL) {
dprintk("Chip %s: Unknown card!\n", dev->name); dev_err(&dev->pdev->dev, "Unknown card!\n");
return -ENODEV; return -ENODEV;
} }
...@@ -920,7 +909,7 @@ static int hifn_enable_crypto(struct hifn_device *dev) ...@@ -920,7 +909,7 @@ static int hifn_enable_crypto(struct hifn_device *dev)
} }
hifn_write_1(dev, HIFN_1_DMA_CNFG, dmacfg); hifn_write_1(dev, HIFN_1_DMA_CNFG, dmacfg);
dprintk("Chip %s: %s.\n", dev->name, pci_name(dev->pdev)); dev_dbg(&dev->pdev->dev, "%s %s.\n", dev->name, pci_name(dev->pdev));
return 0; return 0;
} }
...@@ -984,9 +973,8 @@ static void hifn_init_pll(struct hifn_device *dev) ...@@ -984,9 +973,8 @@ static void hifn_init_pll(struct hifn_device *dev)
freq = simple_strtoul(hifn_pll_ref + 3, NULL, 10); freq = simple_strtoul(hifn_pll_ref + 3, NULL, 10);
else { else {
freq = 66; freq = 66;
printk(KERN_INFO "hifn795x: assuming %uMHz clock speed, " dev_info(&dev->pdev->dev, "assuming %uMHz clock speed, override with hifn_pll_ref=%.3s<frequency>\n",
"override with hifn_pll_ref=%.3s<frequency>\n", freq, hifn_pll_ref);
freq, hifn_pll_ref);
} }
m = HIFN_PLL_FCK_MAX / freq; m = HIFN_PLL_FCK_MAX / freq;
...@@ -1471,8 +1459,8 @@ static int ablkcipher_add(unsigned int *drestp, struct scatterlist *dst, ...@@ -1471,8 +1459,8 @@ static int ablkcipher_add(unsigned int *drestp, struct scatterlist *dst,
drest -= copy; drest -= copy;
nbytes -= copy; nbytes -= copy;
dprintk("%s: copy: %u, size: %u, drest: %u, nbytes: %u.\n", pr_debug("%s: copy: %u, size: %u, drest: %u, nbytes: %u.\n",
__func__, copy, size, drest, nbytes); __func__, copy, size, drest, nbytes);
dst++; dst++;
idx++; idx++;
...@@ -1499,8 +1487,8 @@ static int hifn_cipher_walk(struct ablkcipher_request *req, ...@@ -1499,8 +1487,8 @@ static int hifn_cipher_walk(struct ablkcipher_request *req,
dst = &req->dst[idx]; dst = &req->dst[idx];
dprintk("\n%s: dlen: %u, doff: %u, offset: %u, nbytes: %u.\n", pr_debug("\n%s: dlen: %u, doff: %u, offset: %u, nbytes: %u.\n",
__func__, dst->length, dst->offset, offset, nbytes); __func__, dst->length, dst->offset, offset, nbytes);
if (!IS_ALIGNED(dst->offset, HIFN_D_DST_DALIGN) || if (!IS_ALIGNED(dst->offset, HIFN_D_DST_DALIGN) ||
!IS_ALIGNED(dst->length, HIFN_D_DST_DALIGN) || !IS_ALIGNED(dst->length, HIFN_D_DST_DALIGN) ||
...@@ -1536,14 +1524,13 @@ static int hifn_cipher_walk(struct ablkcipher_request *req, ...@@ -1536,14 +1524,13 @@ static int hifn_cipher_walk(struct ablkcipher_request *req,
* Temporary of course... * Temporary of course...
* Kick author if you will catch this one. * Kick author if you will catch this one.
*/ */
printk(KERN_ERR "%s: dlen: %u, nbytes: %u," pr_err("%s: dlen: %u, nbytes: %u, slen: %u, offset: %u.\n",
"slen: %u, offset: %u.\n", __func__, dlen, nbytes, slen, offset);
__func__, dlen, nbytes, slen, offset); pr_err("%s: please contact author to fix this "
printk(KERN_ERR "%s: please contact author to fix this " "issue, generally you should not catch "
"issue, generally you should not catch " "this path under any condition but who "
"this path under any condition but who " "knows how did you use crypto code.\n"
"knows how did you use crypto code.\n" "Thank you.\n", __func__);
"Thank you.\n", __func__);
BUG(); BUG();
} else { } else {
copy += diff + nbytes; copy += diff + nbytes;
...@@ -1630,11 +1617,11 @@ static int hifn_setup_session(struct ablkcipher_request *req) ...@@ -1630,11 +1617,11 @@ static int hifn_setup_session(struct ablkcipher_request *req)
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
err_out_exit: err_out_exit:
if (err) { if (err) {
printk("%s: iv: %p [%d], key: %p [%d], mode: %u, op: %u, " dev_info(&dev->pdev->dev, "iv: %p [%d], key: %p [%d], mode: %u, op: %u, "
"type: %u, err: %d.\n", "type: %u, err: %d.\n",
dev->name, rctx->iv, rctx->ivsize, rctx->iv, rctx->ivsize,
ctx->key, ctx->keysize, ctx->key, ctx->keysize,
rctx->mode, rctx->op, rctx->type, err); rctx->mode, rctx->op, rctx->type, err);
} }
return err; return err;
...@@ -1685,8 +1672,8 @@ static int ablkcipher_get(void *saddr, unsigned int *srestp, unsigned int offset ...@@ -1685,8 +1672,8 @@ static int ablkcipher_get(void *saddr, unsigned int *srestp, unsigned int offset
saddr += copy; saddr += copy;
offset = 0; offset = 0;
dprintk("%s: copy: %u, size: %u, srest: %u, nbytes: %u.\n", pr_debug("%s: copy: %u, size: %u, srest: %u, nbytes: %u.\n",
__func__, copy, size, srest, nbytes); __func__, copy, size, srest, nbytes);
dst++; dst++;
idx++; idx++;
...@@ -1706,7 +1693,8 @@ static inline void hifn_complete_sa(struct hifn_device *dev, int i) ...@@ -1706,7 +1693,8 @@ static inline void hifn_complete_sa(struct hifn_device *dev, int i)
dev->sa[i] = NULL; dev->sa[i] = NULL;
dev->started--; dev->started--;
if (dev->started < 0) if (dev->started < 0)
printk("%s: started: %d.\n", __func__, dev->started); dev_info(&dev->pdev->dev, "%s: started: %d.\n", __func__,
dev->started);
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
BUG_ON(dev->started < 0); BUG_ON(dev->started < 0);
} }
...@@ -1725,7 +1713,7 @@ static void hifn_process_ready(struct ablkcipher_request *req, int error) ...@@ -1725,7 +1713,7 @@ static void hifn_process_ready(struct ablkcipher_request *req, int error)
t = &rctx->walk.cache[idx]; t = &rctx->walk.cache[idx];
dst = &req->dst[idx]; dst = &req->dst[idx];
dprintk("\n%s: sg_page(t): %p, t->length: %u, " pr_debug("\n%s: sg_page(t): %p, t->length: %u, "
"sg_page(dst): %p, dst->length: %u, " "sg_page(dst): %p, dst->length: %u, "
"nbytes: %u.\n", "nbytes: %u.\n",
__func__, sg_page(t), t->length, __func__, sg_page(t), t->length,
...@@ -1761,9 +1749,8 @@ static void hifn_clear_rings(struct hifn_device *dev, int error) ...@@ -1761,9 +1749,8 @@ static void hifn_clear_rings(struct hifn_device *dev, int error)
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt; struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
int i, u; int i, u;
dprintk("%s: ring cleanup 1: i: %d.%d.%d.%d, u: %d.%d.%d.%d, " dev_dbg(&dev->pdev->dev, "ring cleanup 1: i: %d.%d.%d.%d, u: %d.%d.%d.%d, "
"k: %d.%d.%d.%d.\n", "k: %d.%d.%d.%d.\n",
dev->name,
dma->cmdi, dma->srci, dma->dsti, dma->resi, dma->cmdi, dma->srci, dma->dsti, dma->resi,
dma->cmdu, dma->srcu, dma->dstu, dma->resu, dma->cmdu, dma->srcu, dma->dstu, dma->resu,
dma->cmdk, dma->srck, dma->dstk, dma->resk); dma->cmdk, dma->srck, dma->dstk, dma->resk);
...@@ -1816,9 +1803,8 @@ static void hifn_clear_rings(struct hifn_device *dev, int error) ...@@ -1816,9 +1803,8 @@ static void hifn_clear_rings(struct hifn_device *dev, int error)
} }
dma->dstk = i; dma->dstu = u; dma->dstk = i; dma->dstu = u;
dprintk("%s: ring cleanup 2: i: %d.%d.%d.%d, u: %d.%d.%d.%d, " dev_dbg(&dev->pdev->dev, "ring cleanup 2: i: %d.%d.%d.%d, u: %d.%d.%d.%d, "
"k: %d.%d.%d.%d.\n", "k: %d.%d.%d.%d.\n",
dev->name,
dma->cmdi, dma->srci, dma->dsti, dma->resi, dma->cmdi, dma->srci, dma->dsti, dma->resi,
dma->cmdu, dma->srcu, dma->dstu, dma->resu, dma->cmdu, dma->srcu, dma->dstu, dma->resu,
dma->cmdk, dma->srck, dma->dstk, dma->resk); dma->cmdk, dma->srck, dma->dstk, dma->resk);
...@@ -1867,21 +1853,22 @@ static void hifn_work(struct work_struct *work) ...@@ -1867,21 +1853,22 @@ static void hifn_work(struct work_struct *work)
int i; int i;
struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt; struct hifn_dma *dma = (struct hifn_dma *)dev->desc_virt;
printk("%s: r: %08x, active: %d, started: %d, " dev_info(&dev->pdev->dev,
"success: %lu: qlen: %u/%u, reset: %d.\n", "r: %08x, active: %d, started: %d, "
dev->name, r, dev->active, dev->started, "success: %lu: qlen: %u/%u, reset: %d.\n",
dev->success, dev->queue.qlen, dev->queue.max_qlen, r, dev->active, dev->started,
reset); dev->success, dev->queue.qlen, dev->queue.max_qlen,
reset);
printk("%s: res: ", __func__); dev_info(&dev->pdev->dev, "%s: res: ", __func__);
for (i=0; i<HIFN_D_RES_RSIZE; ++i) { for (i=0; i<HIFN_D_RES_RSIZE; ++i) {
printk("%x.%p ", dma->resr[i].l, dev->sa[i]); pr_info("%x.%p ", dma->resr[i].l, dev->sa[i]);
if (dev->sa[i]) { if (dev->sa[i]) {
hifn_process_ready(dev->sa[i], -ENODEV); hifn_process_ready(dev->sa[i], -ENODEV);
hifn_complete_sa(dev, i); hifn_complete_sa(dev, i);
} }
} }
printk("\n"); pr_info("\n");
hifn_reset_dma(dev, 1); hifn_reset_dma(dev, 1);
hifn_stop_device(dev); hifn_stop_device(dev);
...@@ -1903,9 +1890,9 @@ static irqreturn_t hifn_interrupt(int irq, void *data) ...@@ -1903,9 +1890,9 @@ static irqreturn_t hifn_interrupt(int irq, void *data)
dmacsr = hifn_read_1(dev, HIFN_1_DMA_CSR); dmacsr = hifn_read_1(dev, HIFN_1_DMA_CSR);
dprintk("%s: 1 dmacsr: %08x, dmareg: %08x, res: %08x [%d], " dev_dbg(&dev->pdev->dev, "1 dmacsr: %08x, dmareg: %08x, res: %08x [%d], "
"i: %d.%d.%d.%d, u: %d.%d.%d.%d.\n", "i: %d.%d.%d.%d, u: %d.%d.%d.%d.\n",
dev->name, dmacsr, dev->dmareg, dmacsr & dev->dmareg, dma->cmdi, dmacsr, dev->dmareg, dmacsr & dev->dmareg, dma->cmdi,
dma->cmdi, dma->srci, dma->dsti, dma->resi, dma->cmdi, dma->srci, dma->dsti, dma->resi,
dma->cmdu, dma->srcu, dma->dstu, dma->resu); dma->cmdu, dma->srcu, dma->dstu, dma->resu);
...@@ -1924,9 +1911,9 @@ static irqreturn_t hifn_interrupt(int irq, void *data) ...@@ -1924,9 +1911,9 @@ static irqreturn_t hifn_interrupt(int irq, void *data)
if (restart) { if (restart) {
u32 puisr = hifn_read_0(dev, HIFN_0_PUISR); u32 puisr = hifn_read_0(dev, HIFN_0_PUISR);
printk(KERN_WARNING "%s: overflow: r: %d, d: %d, puisr: %08x, d: %u.\n", dev_warn(&dev->pdev->dev, "overflow: r: %d, d: %d, puisr: %08x, d: %u.\n",
dev->name, !!(dmacsr & HIFN_DMACSR_R_OVER), !!(dmacsr & HIFN_DMACSR_R_OVER),
!!(dmacsr & HIFN_DMACSR_D_OVER), !!(dmacsr & HIFN_DMACSR_D_OVER),
puisr, !!(puisr & HIFN_PUISR_DSTOVER)); puisr, !!(puisr & HIFN_PUISR_DSTOVER));
if (!!(puisr & HIFN_PUISR_DSTOVER)) if (!!(puisr & HIFN_PUISR_DSTOVER))
hifn_write_0(dev, HIFN_0_PUISR, HIFN_PUISR_DSTOVER); hifn_write_0(dev, HIFN_0_PUISR, HIFN_PUISR_DSTOVER);
...@@ -1937,18 +1924,18 @@ static irqreturn_t hifn_interrupt(int irq, void *data) ...@@ -1937,18 +1924,18 @@ static irqreturn_t hifn_interrupt(int irq, void *data)
restart = dmacsr & (HIFN_DMACSR_C_ABORT | HIFN_DMACSR_S_ABORT | restart = dmacsr & (HIFN_DMACSR_C_ABORT | HIFN_DMACSR_S_ABORT |
HIFN_DMACSR_D_ABORT | HIFN_DMACSR_R_ABORT); HIFN_DMACSR_D_ABORT | HIFN_DMACSR_R_ABORT);
if (restart) { if (restart) {
printk(KERN_WARNING "%s: abort: c: %d, s: %d, d: %d, r: %d.\n", dev_warn(&dev->pdev->dev, "abort: c: %d, s: %d, d: %d, r: %d.\n",
dev->name, !!(dmacsr & HIFN_DMACSR_C_ABORT), !!(dmacsr & HIFN_DMACSR_C_ABORT),
!!(dmacsr & HIFN_DMACSR_S_ABORT), !!(dmacsr & HIFN_DMACSR_S_ABORT),
!!(dmacsr & HIFN_DMACSR_D_ABORT), !!(dmacsr & HIFN_DMACSR_D_ABORT),
!!(dmacsr & HIFN_DMACSR_R_ABORT)); !!(dmacsr & HIFN_DMACSR_R_ABORT));
hifn_reset_dma(dev, 1); hifn_reset_dma(dev, 1);
hifn_init_dma(dev); hifn_init_dma(dev);
hifn_init_registers(dev); hifn_init_registers(dev);
} }
if ((dmacsr & HIFN_DMACSR_C_WAIT) && (dma->cmdu == 0)) { if ((dmacsr & HIFN_DMACSR_C_WAIT) && (dma->cmdu == 0)) {
dprintk("%s: wait on command.\n", dev->name); dev_dbg(&dev->pdev->dev, "wait on command.\n");
dev->dmareg &= ~(HIFN_DMAIER_C_WAIT); dev->dmareg &= ~(HIFN_DMAIER_C_WAIT);
hifn_write_1(dev, HIFN_1_DMA_IER, dev->dmareg); hifn_write_1(dev, HIFN_1_DMA_IER, dev->dmareg);
} }
...@@ -2530,8 +2517,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2530,8 +2517,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (pci_resource_len(pdev, 0) < HIFN_BAR0_SIZE || if (pci_resource_len(pdev, 0) < HIFN_BAR0_SIZE ||
pci_resource_len(pdev, 1) < HIFN_BAR1_SIZE || pci_resource_len(pdev, 1) < HIFN_BAR1_SIZE ||
pci_resource_len(pdev, 2) < HIFN_BAR2_SIZE) { pci_resource_len(pdev, 2) < HIFN_BAR2_SIZE) {
dprintk("%s: Broken hardware - I/O regions are too small.\n", dev_err(&pdev->dev, "Broken hardware - I/O regions are too small.\n");
pci_name(pdev));
err = -ENODEV; err = -ENODEV;
goto err_out_free_regions; goto err_out_free_regions;
} }
...@@ -2564,7 +2550,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2564,7 +2550,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
dev->desc_virt = pci_zalloc_consistent(pdev, sizeof(struct hifn_dma), dev->desc_virt = pci_zalloc_consistent(pdev, sizeof(struct hifn_dma),
&dev->desc_dma); &dev->desc_dma);
if (!dev->desc_virt) { if (!dev->desc_virt) {
dprintk("Failed to allocate descriptor rings.\n"); dev_err(&pdev->dev, "Failed to allocate descriptor rings.\n");
err = -ENOMEM; err = -ENOMEM;
goto err_out_unmap_bars; goto err_out_unmap_bars;
} }
...@@ -2583,7 +2569,8 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2583,7 +2569,8 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err = request_irq(dev->irq, hifn_interrupt, IRQF_SHARED, dev->name, dev); err = request_irq(dev->irq, hifn_interrupt, IRQF_SHARED, dev->name, dev);
if (err) { if (err) {
dprintk("Failed to request IRQ%d: err: %d.\n", dev->irq, err); dev_err(&pdev->dev, "Failed to request IRQ%d: err: %d.\n",
dev->irq, err);
dev->irq = 0; dev->irq = 0;
goto err_out_free_desc; goto err_out_free_desc;
} }
...@@ -2603,9 +2590,9 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2603,9 +2590,9 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
INIT_DELAYED_WORK(&dev->work, hifn_work); INIT_DELAYED_WORK(&dev->work, hifn_work);
schedule_delayed_work(&dev->work, HZ); schedule_delayed_work(&dev->work, HZ);
dprintk("HIFN crypto accelerator card at %s has been " dev_dbg(&pdev->dev, "HIFN crypto accelerator card at %s has been "
"successfully registered as %s.\n", "successfully registered as %s.\n",
pci_name(pdev), dev->name); pci_name(pdev), dev->name);
return 0; return 0;
...@@ -2692,8 +2679,7 @@ static int __init hifn_init(void) ...@@ -2692,8 +2679,7 @@ static int __init hifn_init(void)
if (strncmp(hifn_pll_ref, "ext", 3) && if (strncmp(hifn_pll_ref, "ext", 3) &&
strncmp(hifn_pll_ref, "pci", 3)) { strncmp(hifn_pll_ref, "pci", 3)) {
printk(KERN_ERR "hifn795x: invalid hifn_pll_ref clock, " pr_err("hifn795x: invalid hifn_pll_ref clock, must be pci or ext");
"must be pci or ext");
return -EINVAL; return -EINVAL;
} }
...@@ -2705,22 +2691,21 @@ static int __init hifn_init(void) ...@@ -2705,22 +2691,21 @@ static int __init hifn_init(void)
if (hifn_pll_ref[3] != '\0') { if (hifn_pll_ref[3] != '\0') {
freq = simple_strtoul(hifn_pll_ref + 3, NULL, 10); freq = simple_strtoul(hifn_pll_ref + 3, NULL, 10);
if (freq < 20 || freq > 100) { if (freq < 20 || freq > 100) {
printk(KERN_ERR "hifn795x: invalid hifn_pll_ref " pr_err("hifn795x: invalid hifn_pll_ref frequency, must"
"frequency, must be in the range " "be in the range of 20-100");
"of 20-100");
return -EINVAL; return -EINVAL;
} }
} }
err = pci_register_driver(&hifn_pci_driver); err = pci_register_driver(&hifn_pci_driver);
if (err < 0) { if (err < 0) {
dprintk("Failed to register PCI driver for %s device.\n", pr_err("Failed to register PCI driver for %s device.\n",
hifn_pci_driver.name); hifn_pci_driver.name);
return -ENODEV; return -ENODEV;
} }
printk(KERN_INFO "Driver for HIFN 795x crypto accelerator chip " pr_info("Driver for HIFN 795x crypto accelerator chip "
"has been successfully registered.\n"); "has been successfully registered.\n");
return 0; return 0;
} }
...@@ -2729,8 +2714,8 @@ static void __exit hifn_fini(void) ...@@ -2729,8 +2714,8 @@ static void __exit hifn_fini(void)
{ {
pci_unregister_driver(&hifn_pci_driver); pci_unregister_driver(&hifn_pci_driver);
printk(KERN_INFO "Driver for HIFN 795x crypto accelerator chip " pr_info("Driver for HIFN 795x crypto accelerator chip "
"has been successfully unregistered.\n"); "has been successfully unregistered.\n");
} }
module_init(hifn_init); module_init(hifn_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部