/* Basic port configuration */
int sp_get_config(struct sp_port *port, struct sp_port_config *config);
-int sp_set_config(struct sp_port *port, struct sp_port_config *config);
+int sp_set_config(struct sp_port *port, const struct sp_port_config *config);
int sp_set_baudrate(struct sp_port *port, int baudrate);
int sp_set_bits(struct sp_port *port, int bits);
int sp_set_parity(struct sp_port *port, int parity);
static int validate_port(struct sp_port *port);
static struct sp_port **list_append(struct sp_port **list, const char *portname);
static int get_config(struct sp_port *port, struct port_data *data, struct sp_port_config *config);
-static int set_config(struct sp_port *port, struct port_data *data, struct sp_port_config *config);
+static int set_config(struct sp_port *port, struct port_data *data, const struct sp_port_config *config);
int sp_get_port_by_name(const char *portname, struct sp_port **port_ptr)
{
return SP_OK;
}
-static int set_config(struct sp_port *port, struct port_data *data, struct sp_port_config *config)
+static int set_config(struct sp_port *port, struct port_data *data, const struct sp_port_config *config)
{
unsigned int i;
#define TRY(x) do { int ret = x; if (ret != SP_OK) return ret; } while (0)
-int sp_set_config(struct sp_port *port, struct sp_port_config *config)
+int sp_set_config(struct sp_port *port, const struct sp_port_config *config)
{
struct port_data data;
struct sp_port_config prev_config;