diff options
| -rw-r--r-- | drivers/crypto/ixp4xx_crypto.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 21180d6cad6e..830618579102 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c | |||
| @@ -218,23 +218,10 @@ static dma_addr_t crypt_phys; | |||
| 218 | 218 | ||
| 219 | static int support_aes = 1; | 219 | static int support_aes = 1; |
| 220 | 220 | ||
| 221 | static void dev_release(struct device *dev) | ||
| 222 | { | ||
| 223 | return; | ||
| 224 | } | ||
| 225 | |||
| 226 | #define DRIVER_NAME "ixp4xx_crypto" | 221 | #define DRIVER_NAME "ixp4xx_crypto" |
| 227 | static struct platform_device pseudo_dev = { | ||
| 228 | .name = DRIVER_NAME, | ||
| 229 | .id = 0, | ||
| 230 | .num_resources = 0, | ||
| 231 | .dev = { | ||
| 232 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
| 233 | .release = dev_release, | ||
| 234 | } | ||
| 235 | }; | ||
| 236 | 222 | ||
| 237 | static struct device *dev = &pseudo_dev.dev; | 223 | static struct platform_device *pdev; |
| 224 | static struct device *dev; | ||
| 238 | 225 | ||
| 239 | static inline dma_addr_t crypt_virt2phys(struct crypt_ctl *virt) | 226 | static inline dma_addr_t crypt_virt2phys(struct crypt_ctl *virt) |
| 240 | { | 227 | { |
| @@ -1418,20 +1405,30 @@ static struct ixp_alg ixp4xx_algos[] = { | |||
| 1418 | } }; | 1405 | } }; |
| 1419 | 1406 | ||
| 1420 | #define IXP_POSTFIX "-ixp4xx" | 1407 | #define IXP_POSTFIX "-ixp4xx" |
| 1408 | |||
| 1409 | static const struct platform_device_info ixp_dev_info __initdata = { | ||
| 1410 | .name = DRIVER_NAME, | ||
| 1411 | .id = 0, | ||
| 1412 | .dma_mask = DMA_BIT_MASK(32), | ||
| 1413 | }; | ||
| 1414 | |||
| 1421 | static int __init ixp_module_init(void) | 1415 | static int __init ixp_module_init(void) |
| 1422 | { | 1416 | { |
| 1423 | int num = ARRAY_SIZE(ixp4xx_algos); | 1417 | int num = ARRAY_SIZE(ixp4xx_algos); |
| 1424 | int i,err ; | 1418 | int i, err ; |
| 1425 | 1419 | ||
| 1426 | if (platform_device_register(&pseudo_dev)) | 1420 | pdev = platform_device_register_full(&ixp_dev_info); |
| 1427 | return -ENODEV; | 1421 | if (IS_ERR(pdev)) |
| 1422 | return PTR_ERR(pdev); | ||
| 1423 | |||
| 1424 | dev = &pdev->dev; | ||
| 1428 | 1425 | ||
| 1429 | spin_lock_init(&desc_lock); | 1426 | spin_lock_init(&desc_lock); |
| 1430 | spin_lock_init(&emerg_lock); | 1427 | spin_lock_init(&emerg_lock); |
| 1431 | 1428 | ||
| 1432 | err = init_ixp_crypto(); | 1429 | err = init_ixp_crypto(); |
| 1433 | if (err) { | 1430 | if (err) { |
| 1434 | platform_device_unregister(&pseudo_dev); | 1431 | platform_device_unregister(pdev); |
| 1435 | return err; | 1432 | return err; |
| 1436 | } | 1433 | } |
| 1437 | for (i=0; i< num; i++) { | 1434 | for (i=0; i< num; i++) { |
| @@ -1496,7 +1493,7 @@ static void __exit ixp_module_exit(void) | |||
| 1496 | crypto_unregister_alg(&ixp4xx_algos[i].crypto); | 1493 | crypto_unregister_alg(&ixp4xx_algos[i].crypto); |
| 1497 | } | 1494 | } |
| 1498 | release_ixp_crypto(); | 1495 | release_ixp_crypto(); |
| 1499 | platform_device_unregister(&pseudo_dev); | 1496 | platform_device_unregister(pdev); |
| 1500 | } | 1497 | } |
| 1501 | 1498 | ||
| 1502 | module_init(ixp_module_init); | 1499 | module_init(ixp_module_init); |
