Skip to content

Commit

Permalink
Merge tag 'v5.19-p3' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/herbert/crypto-2.6

Pull crypto fix from Herbert Xu:
 "Fix a regression that breaks the ccp driver"

* tag 'v5.19-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: ccp - Fix device IRQ counting by using platform_irq_count()
  • Loading branch information
Linus Torvalds committed Jun 30, 2022
2 parents d9b2ba6 + 87d0440 commit f5da5dd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/crypto/ccp/sp-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,9 @@ static int sp_get_irqs(struct sp_device *sp)
struct sp_platform *sp_platform = sp->dev_specific;
struct device *dev = sp->dev;
struct platform_device *pdev = to_platform_device(dev);
unsigned int i, count;
int ret;

for (i = 0, count = 0; i < pdev->num_resources; i++) {
struct resource *res = &pdev->resource[i];

if (resource_type(res) == IORESOURCE_IRQ)
count++;
}

sp_platform->irq_count = count;
sp_platform->irq_count = platform_irq_count(pdev);

ret = platform_get_irq(pdev, 0);
if (ret < 0) {
Expand All @@ -104,7 +96,7 @@ static int sp_get_irqs(struct sp_device *sp)
}

sp->psp_irq = ret;
if (count == 1) {
if (sp_platform->irq_count == 1) {
sp->ccp_irq = ret;
} else {
ret = platform_get_irq(pdev, 1);
Expand Down

0 comments on commit f5da5dd

Please sign in to comment.