summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi/kcs_bmc_npcm7xx.c
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2021-06-08 13:47:47 +0300
committerCorey Minyard <cminyard@mvista.com>2021-06-22 03:50:13 +0300
commitfaae6e391eda73a5b9870c78349064282a625bfa (patch)
treea1ce442f82c7cc0a365450cfa2278f0e18daa137 /drivers/char/ipmi/kcs_bmc_npcm7xx.c
parentd7096970075ef47c9906fd241cc4939cc11ddd01 (diff)
downloadlinux-faae6e391eda73a5b9870c78349064282a625bfa.tar.xz
ipmi: kcs_bmc: Split headers into device and client
Strengthen the distinction between code that abstracts the implementation of the KCS behaviours (device drivers) and code that exploits KCS behaviours (clients). Neither needs to know about the APIs required by the other, so provide separate headers. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Message-Id: <20210608104757.582199-7-andrew@aj.id.au> Reviewed-by: Zev Weiss <zweiss@equinix.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi/kcs_bmc_npcm7xx.c')
-rw-r--r--drivers/char/ipmi/kcs_bmc_npcm7xx.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/char/ipmi/kcs_bmc_npcm7xx.c b/drivers/char/ipmi/kcs_bmc_npcm7xx.c
index e06250285113..ebb691af28c5 100644
--- a/drivers/char/ipmi/kcs_bmc_npcm7xx.c
+++ b/drivers/char/ipmi/kcs_bmc_npcm7xx.c
@@ -17,7 +17,7 @@
#include <linux/regmap.h>
#include <linux/slab.h>
-#include "kcs_bmc.h"
+#include "kcs_bmc_device.h"
#define DEVICE_NAME "npcm-kcs-bmc"
#define KCS_CHANNEL_MAX 3
@@ -128,10 +128,7 @@ static irqreturn_t npcm7xx_kcs_irq(int irq, void *arg)
{
struct kcs_bmc *kcs_bmc = arg;
- if (!kcs_bmc_handle_event(kcs_bmc))
- return IRQ_HANDLED;
-
- return IRQ_NONE;
+ return kcs_bmc_handle_event(kcs_bmc);
}
static int npcm7xx_kcs_config_irq(struct kcs_bmc *kcs_bmc,
@@ -148,6 +145,12 @@ static int npcm7xx_kcs_config_irq(struct kcs_bmc *kcs_bmc,
dev_name(dev), kcs_bmc);
}
+static const struct kcs_bmc_device_ops npcm7xx_kcs_ops = {
+ .io_inputb = npcm7xx_kcs_inb,
+ .io_outputb = npcm7xx_kcs_outb,
+ .io_updateb = npcm7xx_kcs_updateb,
+};
+
static int npcm7xx_kcs_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -179,9 +182,7 @@ static int npcm7xx_kcs_probe(struct platform_device *pdev)
kcs_bmc->ioreg.idr = priv->reg->dib;
kcs_bmc->ioreg.odr = priv->reg->dob;
kcs_bmc->ioreg.str = priv->reg->sts;
- kcs_bmc->io_inputb = npcm7xx_kcs_inb;
- kcs_bmc->io_outputb = npcm7xx_kcs_outb;
- kcs_bmc->io_updateb = npcm7xx_kcs_updateb;
+ kcs_bmc->ops = &npcm7xx_kcs_ops;
platform_set_drvdata(pdev, priv);