aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-11-16 14:40:03 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:06 -0800
commite6b969ce43ce8c380c14ab7acdb00009f6d99c17 (patch)
tree9bdc190d2804e1d4461514531f00aca01182a787 /mpm/lib
parent96a2061a59c913bc48f50ba89471519809c7629a (diff)
downloaduhd-e6b969ce43ce8c380c14ab7acdb00009f6d99c17.tar.gz
uhd-e6b969ce43ce8c380c14ab7acdb00009f6d99c17.tar.bz2
uhd-e6b969ce43ce8c380c14ab7acdb00009f6d99c17.zip
mpm: Minor spidev fixes
Fixes some compiler warnings.
Diffstat (limited to 'mpm/lib')
-rw-r--r--mpm/lib/spi/spidev.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/mpm/lib/spi/spidev.c b/mpm/lib/spi/spidev.c
index 1339fa1e6..646ff8bf3 100644
--- a/mpm/lib/spi/spidev.c
+++ b/mpm/lib/spi/spidev.c
@@ -1,18 +1,7 @@
//
-// Copyright 2017 Ettus Research (National Instruments)
+// Copyright 2017 Ettus Research, National Instruments Company
//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// SPDX-License-Identifier: GPL-3.0
//
#include "spidev.h"
@@ -30,8 +19,6 @@ int init_spi(int *fd, const char *device,
const uint8_t bits_per_word,
const uint16_t delay_us
) {
- int err;
-
if (!fd)
{
fprintf(stderr, "%s: was passed a null pointer\n",
@@ -84,7 +71,7 @@ int init_spi(int *fd, const char *device,
if (ioctl(*fd, SPI_IOC_RD_BITS_PER_WORD, &coerced_bits_per_word) < 0)
{
int err = errno;
- fprintf(stderr, "%s: Failed to get bits per word\n",
+ fprintf(stderr, "%s: Failed to get bits per word (%s)\n",
__func__, strerror(err));
return err;
}
@@ -99,7 +86,7 @@ int init_spi(int *fd, const char *device,
if (ioctl(*fd, SPI_IOC_WR_MAX_SPEED_HZ, &set_speed_hz) < 0)
{
int err = errno;
- fprintf(stderr, "%s: Failed to set speed\n",
+ fprintf(stderr, "%s: Failed to set speed (%s)\n",
__func__, strerror(err));
return err;
}
@@ -108,7 +95,7 @@ int init_spi(int *fd, const char *device,
if (ioctl(*fd, SPI_IOC_RD_MAX_SPEED_HZ, &coerced_speed_hz) < 0)
{
int err = errno;
- fprintf(stderr, "%s: Failed to get speed\n",
+ fprintf(stderr, "%s: Failed to get speed (%s)\n",
__func__, strerror(err));
return err;
}