summaryrefslogtreecommitdiff
path: root/drivers/ata/pata_parport/pata_parport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_parport/pata_parport.c')
-rw-r--r--drivers/ata/pata_parport/pata_parport.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c
index c1576d943b43..1af64d435d3c 100644
--- a/drivers/ata/pata_parport/pata_parport.c
+++ b/drivers/ata/pata_parport/pata_parport.c
@@ -6,7 +6,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/parport.h>
-#include <linux/pata_parport.h>
+#include "pata_parport.h"
#define DRV_NAME "pata_parport"
@@ -276,7 +276,7 @@ static void pi_release(struct pi_adapter *pi)
module_put(pi->proto->owner);
}
-static int default_test_proto(struct pi_adapter *pi, char *scratch)
+static int default_test_proto(struct pi_adapter *pi)
{
int j, k;
int e[2] = { 0, 0 };
@@ -300,21 +300,21 @@ static int default_test_proto(struct pi_adapter *pi, char *scratch)
return e[0] && e[1]; /* not here if both > 0 */
}
-static int pi_test_proto(struct pi_adapter *pi, char *scratch)
+static int pi_test_proto(struct pi_adapter *pi)
{
int res;
parport_claim_or_block(pi->pardev);
if (pi->proto->test_proto)
- res = pi->proto->test_proto(pi, scratch, 1);
+ res = pi->proto->test_proto(pi);
else
- res = default_test_proto(pi, scratch);
+ res = default_test_proto(pi);
parport_release(pi->pardev);
return res;
}
-static bool pi_probe_mode(struct pi_adapter *pi, int max, char *scratch)
+static bool pi_probe_mode(struct pi_adapter *pi, int max)
{
int best, range;
@@ -326,7 +326,7 @@ static bool pi_probe_mode(struct pi_adapter *pi, int max, char *scratch)
range = 8;
if (range == 8 && pi->port % 8)
return false;
- return !pi_test_proto(pi, scratch);
+ return !pi_test_proto(pi);
}
best = -1;
for (pi->mode = 0; pi->mode < max; pi->mode++) {
@@ -335,14 +335,14 @@ static bool pi_probe_mode(struct pi_adapter *pi, int max, char *scratch)
range = 8;
if (range == 8 && pi->port % 8)
break;
- if (!pi_test_proto(pi, scratch))
+ if (!pi_test_proto(pi))
best = pi->mode;
}
pi->mode = best;
return best > -1;
}
-static bool pi_probe_unit(struct pi_adapter *pi, int unit, char *scratch)
+static bool pi_probe_unit(struct pi_adapter *pi, int unit)
{
int max, s, e;
@@ -367,14 +367,14 @@ static bool pi_probe_unit(struct pi_adapter *pi, int unit, char *scratch)
for (pi->unit = s; pi->unit < e; pi->unit++) {
if (pi->proto->probe_unit(pi)) {
parport_release(pi->pardev);
- return pi_probe_mode(pi, max, scratch);
+ return pi_probe_mode(pi, max);
}
}
parport_release(pi->pardev);
return false;
}
- return pi_probe_mode(pi, max, scratch);
+ return pi_probe_mode(pi, max);
}
static void pata_parport_dev_release(struct device *dev)
@@ -399,7 +399,7 @@ static struct device pata_parport_bus = {
.release = pata_parport_bus_release,
};
-static struct scsi_host_template pata_parport_sht = {
+static const struct scsi_host_template pata_parport_sht = {
PATA_PARPORT_SHT("pata_parport")
};
@@ -420,7 +420,6 @@ static struct pi_adapter *pi_init_one(struct parport *parport,
struct pi_protocol *pr, int mode, int unit, int delay)
{
struct pardev_cb par_cb = { };
- char scratch[512];
const struct ata_port_info *ppi[] = { &pata_parport_port_info };
struct ata_host *host;
struct pi_adapter *pi;
@@ -473,12 +472,12 @@ static struct pi_adapter *pi_init_one(struct parport *parport,
if (!pi->pardev)
goto out_module_put;
- if (!pi_probe_unit(pi, unit, scratch)) {
+ if (!pi_probe_unit(pi, unit)) {
dev_info(&pi->dev, "Adapter not found\n");
goto out_unreg_parport;
}
- pi->proto->log_adapter(pi, scratch, 1);
+ pi->proto->log_adapter(pi);
host = ata_host_alloc_pinfo(&pi->pardev->dev, ppi, 1);
if (!host)
@@ -534,7 +533,7 @@ int pata_parport_register_driver(struct pi_protocol *pr)
if (probe) {
/* probe all parports using this protocol */
idr_for_each_entry(&parport_list, parport, port_num)
- pi_init_one(parport, pr, -1, 0, -1);
+ pi_init_one(parport, pr, -1, -1, -1);
}
mutex_unlock(&pi_mutex);
@@ -558,8 +557,7 @@ void pata_parport_unregister_driver(struct pi_protocol *pr)
}
EXPORT_SYMBOL_GPL(pata_parport_unregister_driver);
-static ssize_t new_device_store(struct bus_type *bus, const char *buf,
- size_t count)
+static ssize_t new_device_store(const struct bus_type *bus, const char *buf, size_t count)
{
char port[12] = "auto";
char protocol[8] = "auto";
@@ -633,8 +631,7 @@ static void pi_remove_one(struct device *dev)
/* pata_parport_dev_release will do ida_free(dev->id) and kfree(pi) */
}
-static ssize_t delete_device_store(struct bus_type *bus, const char *buf,
- size_t count)
+static ssize_t delete_device_store(const struct bus_type *bus, const char *buf, size_t count)
{
struct device *dev;
@@ -669,7 +666,7 @@ static void pata_parport_attach(struct parport *port)
if (probe) {
/* probe this port using all protocols */
idr_for_each_entry(&protocols, pr, pr_num)
- pi_init_one(port, pr, -1, 0, -1);
+ pi_init_one(port, pr, -1, -1, -1);
}
mutex_unlock(&pi_mutex);
}